|
发表于 2020-2-27 18:41:46
|
显示全部楼层
0.100
1.无数
2.a,b,c
3.c=3,a=14,b=9
4.int x,z;
if(x >= 0)
{
z = x;
}
else
{
z = -x
}
5.if(size > 12)
{
cost = cost * 1.05;
flag = 2;
}
else
{
blii = cost * flag;
}
if(ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
help = 2 * sheds;
}
readin: scanf("%d", &score);
while(score >= 0)
{
count++;
scanf("%d", &score);
}
printf("count = %d\n", count);
#include<stdio.h>
int main()
{
double xjy=10000;
double hy=10000;
int year;
for(year=1; xjy >= hy; year++)
{
xjy = 10000 + 10000 * year * 0.1;
hy = hy + hy * 0.05;
}
year--;
printf("%d年后,黑夜的投资额超过小甲鱼!\n",year);
printf("小甲鱼的投资额是:%.2lf\n",xjy);
printf("黑夜的投资额是: %.2lf\n",hy);
return 0;
}
1.#include<stdio.h>
int main()
{
int jc=4000000;
int year;
for(year=0; jc > 0; year++)
{
jc = jc * (1 + 0.08);
jc = jc - 500000;
}
year--;
year--;
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗......\n",year);
}
2.#include<stdio.h>
#include<math.h>
int main()
{
double sum;
double j;
int i;
for(sum = 1.0,i = 1,j=0;sum < 1000; sum = sum + 2,i++)
{
j = j + (pow(-1,i - 1) * (1 / sum));
}
printf("Π/4≈%.7lf\n",j);
}
3.2的24次方 |
|