|
发表于 2022-9-26 12:46:49
|
显示全部楼层
《零基础入门学习C语言》
小甲鱼 著
立即购买
0. 10
1. 0
2. a,b,c
3.
4.z = x>0?x:(-1*x)
5.
A:
if (size > 12)
{
cost = cost*1,05;
}
else
{
b: 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);
break;}
count++;
}while(score>0);
0.
#include<stdio.h>
int main()
{
float xjy,heiye;
int year = 0;
xjy = heiye = 10000;
for(;xjy>=heiye;year++)
{
xjy = xjy + 1000;
heiye = heiye + heiye*0.05;
}
printf("%d年后,黑夜超过小甲鱼\n小甲鱼:%.2f\n黑夜:%.2f",year,xjy,heiye);
return 0;
}
1.
#include<stdio.h>
int main()
{
int year = 0;
float money = 400;
for(;money>0;year++)
{
money = money - 50;
money = money + money*0.08;
}
printf("%d",year);
return 0;
}
2.
3.
|
|