|
发表于 2021-3-19 14:42:50
|
显示全部楼层
0. 81个
1. 11个
2. a,b,c
3. a=5 , b = 4,c=11
4. z = sqrt(pow(x,2))
5.
A.
if (size >12)
{
cost = cost * 1.05;
flag = 2;
bill = cost * flag;
}
else
{
bill = cost * flag;
}
B.
if (ibx > 14)
{
sheds = 3;
}
else
{
sheds = 2;
help = 2 * sheds;
}
C.
if (score < 0)
{
printf("count = %d\n",count);
}
else
{
count++;
scanf("%d",score);
}
动动手:
0.
#include <stdio.h>
#include <math.h>
int main()
{
float a = 10000,b = 10000;
int year = 1;
float a1 = 10000 * 0.1;
float b1 = (b * 0.05);
do
{
a = year * 10000 * 0.1 + 10000;
b = pow(b1,year);
if(a >= b)
{
year++;
b - 10000;
}
else
{
printf("%d年后,黑夜的投资超过小甲鱼。",year);
printf("小甲鱼的投资额是%.2f",a);
printf("黑夜的投资额是%.2f",b);
break;
}
}while(year != 0);
return 0;
}
1.
#include <stdio.h>
#include <math.h>
int main()
{
float a;
float b,c,i;
for(i = 0,a = 4000000;a >= 0;i++)
{
a = a * (1 + 0.08) - 500000;
}
printf("%d年后,小甲败光了所有家产,再次回到一贫如洗。",i);
return 0;
}
2. |
|