|
发表于 2021-9-29 18:22:15
|
显示全部楼层
0、10
1、0
2、a.b.c
3、a=14,b=5,c=9
4、
#include <stdio.h>
int main()
{
int x=-5, z;
z = x < 0 ? -x : x;
printf("%d",z);
return 0;
}
5、
#include <stdio.h>
int main()
{
int size, cost, bill, flag;
if (size > 12)
{
cost = cost * 1.05;
}
flag = 2;
bill = cost * flag;
return 0;
}
B、
if (ibex > 14)
sheds = 3;
else
sheds = 2;
help = 2 * sheds;
C、
do{
scanf("%d", &score);
count++;
} while (score > 0);
printf("count = %d\n", count-1);
动动手
0、
int years = 0;
float count1 = 10000, count2 = 10000;
do
{
years++;
count1 += 1000 * years;
count2 += count2 * 0.05;
} while(count2<count1);
printf("%d年后,黑夜的投资额超过了小甲鱼!\n", years);
printf("小甲鱼的投资额是:%0.2f\n", count1);
printf("黑夜的投资额是%0.2f\n", count2);
return 0;
1、
int years = 0;
float count = 4000000;
do
{
years++;
count -= 500000;
count += count*0.08;
} while(count>0);
printf("%d年后,小甲鱼败光了所以的家产,再次回到一贫如洗......\n", years);
return 0;
2、
double i = 1, count = 0, pi;
while (fabs(1 / i) > pow(10, -8))
{
count += 1 / i;
i = -i;
if (i < 0)
i -= 2;
else
i += 2;
}
pi = count * 4;
printf("%lf", pi);
3、
|
|