|
|
0.11个
1.9个
2.a,b,c均为左值?
3.a = 14,b = 5,c = 9//括号中最后一个结果赋值给a其中的4无意义
4.z = (x>0?a:-a)
5.A.- if (size > 12)
- {
- cost = cost*1.05;
- flag = 2;
- }
- bill = cost*flag;
复制代码
B.- if(ibex > 14)
- {
- sheds = 3;
- }
- else
- {
- sheds = 2;
- }
- help = 2 * sheds;
复制代码
C.- int count = -1
- do
- {
- scanf("%d",&score);
- count ++;
- }
- while(score < 0);
- printf("count = %d\n",count);
复制代码
动动手0.- #include <stdio.h>
- int main()
- {
- double i,j;
- i = j = 10000;
- int count = 0;
-
- while(i <= j)
- {
- i = i * 1.05;
- j = j + 1000;
- count ++;
- }
- printf("%d年后,黑夜的投资额超过小甲鱼!\n",count);
- printf("小甲鱼的投资额是:%.2f\n",j);
- printf("黑夜的投资额是:%.2f\n",i);
- return 0;
- }
复制代码 |
|