{:10_269:}
我想知道答案
小甲鱼,编程题的第二题题目表达的不过清晰,我一开始以为是先投资后消费,但看了答案才发现并不是而是先消费在投资。{:10_247:}
朕想知道
顶楼主
查看
答案
·······················
太好了 , 終於到了這邊了 .. 之前課程真的很努力在學習...
{:9_227:}
啊
test
0 10, 因为是先用后加,第一次循环完,j的值是10
1 0, 因为开始i的值是0,并没有进入while循环
2 c, b, a
3 a=15, b=5, c=10
4 z=x<0?-x:x;
5
(1)
if (size>12)
{
cost=cost*1.05;
flag=2;
}
bill=cost*flag;
(2)
if (ibex>14)
{
sheds=3;
}
else{sheds=2;}
help=2*sheds;
(3)
scanf("%d", &score)
while (score>=0)
{count++; scanf("%d", &score);}
看看答案
1.10次,因为第一个for的判断语句为逗号运算符所以判断第二个表达式是否为真,第二个表达式j=10时为假,所以i++,然后判断j!=10为假,结束循环。
2.0次,因为i++为先运算后自加1,所以while的值为为假。
3.a,b,c,。
4.14,5,9。不懂??
5.???
6. A if(size > 12)
{
cost = cost * 1.05;
flag = 2;
}
Else
{
bill = cost * flag;
}
B if(ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
}
help = 2 * sheds;
C do
{
scanf("%d",&score);
if(score>0)
{
count++;
}
}
while(score>0);
printf("count = %d\n",count);
{:10_243:}
对一下答案
11
测试题:
0.10个
1.0个
2.a,b,c
3.14,5,9
4.
#include<stdio.h>
int main()
{
int x,z;
printf("请输入一个数字: ");
scanf("%d",&x);
z=(x<0)?-x:x;
printf("%d",z);
return 0;
}
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:
readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
readin;
动动手:
0.
#include<stdio.h>
int main()
{
float p = 10000.00;
float xjy ,hy;
int n = 0;
while (xjy > hy)
{
n++;
xjy = p + p*0.1*n;
hy = p * pow(1+0.05,n);
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",n);
printf("小甲鱼的投资额是:%.2f",xjy);
printf("黑夜的投资额是:%.2f",hy);
return 0;
}
拾遗