|
发表于 2019-6-15 15:38:13
|
显示全部楼层
0:回答出10个'A'
1:一个都不会打印。
2:a = 5;
3: a == 14, b == 5, c == 9;
4: z = x > 0 ? x : -x;
5:A if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
else
{
bill = cost * flag;
}
B: if ( ibex > 14)
{
sheds = 3;
}
else
{
help = 2 * sheds;
}
C: while (score >= 0)
{
count++;
scanf("%d", &score);
}
printf("count = %d\n", count);
动动手:
0: for (years = 1; single >= compound; years++)
{
//l=p*i*n
single = 10000 + (10000 * (0.1 * years));
//s=p*(1+i)^n
compound = (10000 * pow((1 + 0.05), years));
++year;
}
printf("%d年后,黑夜的投资额超过王八蛋!\n\
王八蛋的投资额是:%.2f\n\
黑夜的投资额是:%.2f", year, single, compound);
1:
for (years = 1; total_amount > 0; years++)
{
total_amount = total_amount - 500000;
total_amount = (total_amount * 0.08) + total_amount;
if (total_amount <= 500000)
{
total_amount = total_amount - total_amount;
}
}
printf("%d年之后,会小王八^_^会败光所有家产,再次一穷二白。", years);
2:
3: |
|