星期五, 3月 11, 2005

3/11 Lab

3/11 Lab

1. Let i=2;
Print i;
Print 2 * (i++);
Print i;

Ans: 2, 4, 3

2. Let i=2;
Print i;
Print 2 * (++i);
Print i;

Ans: 2, 6, 3

3. Let m=7, n=2;
Print (double) m/n;
Print m/ (double)n;

Ans: 3.5, 3.5

4. Codemate 1.01

Ans: Consumption of 1136.3636363636365 kg of soda would kill a person weighing 50.0 kg.


5 Codemate 1.03