|
发表于 2017-2-18 22:05:12
|
显示全部楼层
0.程序有误,for()i = 0; i = 10, j != 10; i++)时打印10个
1.10个
2.a
3.b = 3,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;
- }
- sheds = 2;
复制代码
C.- if(score < 0)
- {
- printf(“count = %d\n”, count);
- }
- count++;
- scanf(“%d”,&score);
复制代码
0.- #include <stdio.h>
- #include <math.h>
- int main() {
- float a, b;
- int i = 1;
- while (a > b) {
- a = 10000 * (1 + 0.1 * i);
- b = 10000 * pow((1 + 0.05), i);
- i++;
- }
- printf("%d年后,黑夜的投资额超过小甲鱼!\n小甲鱼的投资额是:%.2f\n黑夜的投资额是:%.2f", i - 1, a, b);
- return 0;
- }
复制代码
1.- #include <stdio.h>
- #include <math.h>
- int main() {
- int year = 1, a;
- while (a > 0) {
- a = ((4000000 * (1 + 0.08 * year)) - (500000 * year));
- year++;
- }
- printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗.....", year);
- return 0;
- }
复制代码
剩下的实在是太难了啊 |
|