|
发表于 2020-4-11 20:28:12
|
显示全部楼层
0:10个A
1:0个B
2:a,b,c
3:b=5, c = 10, a = 15;
4:z = sqrt(x * x);
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
- do
- {
- scanf("%d", &score);
- if(score < 0);
- {
- printf("count = %d\n", count);
- }
- count++;
- continue;
- }while(1);
复制代码
0.
- #include <stdio.h>
- int main()
- {
- float a = 10000, xjy = 10000, hy = 10000;
- int b = 0;
-
- do
- {
- xjy = a * 10 / 100 + xjy;
- hy = hy * 5 / 100 + hy;
- b++;
- }while(hy < xjy);
-
- printf("%d年后,黑夜的投资额超过小甲鱼!\n", b);
- printf("小甲鱼的投资额是:%.2f\n", xjy);
- printf("黑夜的投资额是:%.2f\n", hy);
-
- return 0;
- }
复制代码
1:
- #include <stdio.h>
- int main()
- {
- int i = 4000000, b = 0;
-
- do
- {
- b++;
- i = i - 500000;
- i = i * 8 / 100 + i;
- }while(i > 0);
-
- printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗......\n", b);
-
- return 0;
- }
复制代码
2:
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- double d, c;
- int a, b;
-
- for(a = 1, b = 1; 1; b += 2)
- {
- if(a = b)
- {
- c = a / b;
- continue;
- }
- d = -a / b;
- if(sqrt(d * d) < pow(10, -8))
- {
- break;
- }
- c = c + d;
- }
-
- c = c * 4;
-
- printf("pi的近似值为%f\n", c);
-
- return 0;
- }
复制代码
3:
- #include <stdio.h>
- int main()
- {
- int a = 1, b = 0, c = 0, d;
-
- for(; c != 24; c++)
- {
- if(c > 2 && c <= 6)
- {
- a = a + 1;
- b = b - 1;
- }
- else if(c > 6)
- {
- b = b - a / 2;
- a = a / 2 + a;
- }
- b = b + a;
- }
- d = a + b;
-
- printf("两年后可以繁殖%d对兔子\n", d);
-
- return 0;
- }
复制代码
|
|