|
发表于 2018-10-28 14:51:25
|
显示全部楼层
0:
100
1:
0
2:
c b a
3:
5+4=9
5
4
4:
z=x>=0?x:(-x);
5:
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
if (ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
while(1)
{
scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
count++;
}
}
0:
# include <stdio.h>
int main ()
{
int i =1;
for(;10000*0.1*i > 10000*pow(1.05,i)-10000;i++ )
{
;
}
printf("%d,%f,%f",i,10000*0.1*i+10000,10000*pow(1.05,i));
return 0;
}
1:
# include <stdio.h>
int main ()
{
int i = 0;
int restmoney =400;
for(;restmoney > 0;i++)
{
restmoney = restmoney - 50;
restmoney = restmoney * (1+0.08);
}
printf("%d",i);
return 0;
}
2:
# include <stdio.h>
# include <math.h>
int main ()
{
int i = 1;
int j = 1;
double sum = 0;
double last = 1;
for(;last > pow(10 , -8);)
{
i = i + 2;
sum = sum + 1 + 1/(pow(-1,j)*i);
last = fabs(1/(pow(-1,j)*i));
printf("%.9f\n", last);
j++;
}
printf("%.7f", 4*sum);
return 0;
}
3:
28657
|
|