winsome8538
发表于 2020-3-3 15:02:15
#include<stdio.h>
#include<math.h>
int main()
{
int money1, money2;
int year = 0;
int a;
while (year != -1)
{
money1 = year * 10000 * 0.1 + 10000;
money2 = pow((1 + 0.05),year) * 10000;
a = money2 - money1;
if (a > 0)
{
printf("第%d年超过\n", year);
break;
}
year = year + 1;
}
return 0;
}
水下月
发表于 2020-3-3 15:28:35
0. 10个
1. 11个
2. a
3. a=15 b=5 c =10
4.#include<stdio.h>
int main()
{
int x, z;
printf("请输入一个变量:\n");
scanf("%d",&x);
if(x>=0)
{
z = x;
}
else if(x<0)
{
x=0 - x;
z = x;
}
printf("%d\n",z);
return 0;
}
Chprcina
发表于 2020-3-3 15:31:48
0. 10
1.
2. b = c = 5
3. 14 5 9
4. z=(x>0)?x:-x
5. if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}else
bill = cost * flag;
if (ibex > 14)
{
sheds = 3;
}else{sheds = 2;help = 2 * sheds;}
readin: scanf("%d", &score);
while(score >= 0)
{
readin: scanf("%d", &score);
count++;
}
count++;
printf("count = %d\n", count);
jimmyrong
发表于 2020-3-3 15:34:35
1
Draem
发表于 2020-3-3 16:38:05
10个
10个
a,b,c
a=14,b=5,c=9
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
bill = cost * flag;
}
else bill = cost * flag;if (ibex > 14)
{
sheds = 3;
help = 2 * sheds;
}
else
{
sheds = 2;
help = 2 * sheds;
}while(1)
{
readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
break;
}
count++;
}# include<stdio.h>
int main(void)
{
float a,b,c;
int i;
printf("请输入小甲鱼和黑夜的初始资金:\n");
scanf("%f",&a);
b=c=a;
for(i=1;b<=c;i++)
{
c = a*(1+0.1*i);
b *=(1+0.05);
}
printf("%d年以后,黑夜的资产超过小甲鱼\n",i);
printf("小甲鱼的资产是:%.2f\n黑夜的资产是:%.2f\n",c,b);
return 0;
}# include<stdio.h>
int main(void)
{
float lottery=400;
int year = 0;
while(lottery>0)
{
lottery = (lottery - 50)*(1+0.08);
year ++;
}
printf("%d年后,小甲鱼败光所有家产,再次回到一贫如洗!\n",year);
}# include<stdio.h>
# include<math.h>
int main(void)
{
float pi = 1, a = 3;
while(fabs(1/a)>10^(-8))
{
pi = pi + (-1/a);
a = -(a+2);
}
printf("精确到小数后七位的圆周率是:%.7f",4*pi);
return 0;
}
诚信肥宅
发表于 2020-3-3 17:43:25
。
爱学习的LYH
发表于 2020-3-3 22:36:16
0. 10个A
1.10个B(上机后结果为不会打印,复习了i++的逻辑)
2.a=5;b=5;c=5;
3.a=13 b=3 c =9
4.if(x<0)
{x=-x;}
5.if(size>12)
{cost *=1.05;
flag=2;
}
else
{bill=cost*flag;}
if(ibex>14)
{
sheds =3;
}
else
{
sheds=2;
help=2*sheds;
}
while(1)
{
readin:scanf("%d",&score);
if(score<0)
{
printf("count=%d\n",count);
break;
}
count++;
}
李全朝20200226
发表于 2020-3-3 22:45:28
#include<stdio.h>
#include<math.h>
int main()
{
int i;
double a=10000,b;
for (i=1;;i++)
{
a=a+10000*0.1;
b=10000*pow(1.05,i);
if(a<b)
{
printf("%d年后,黑夜的投资额超过小甲鱼!\n",i);
printf("小甲鱼的投资额是:%.2f\n",a);
printf("黑夜的投资额是:%.2f\n",b);
break;
}
}
return 0;
}
谢啸虎
发表于 2020-3-3 22:51:06
1
自在如风
发表于 2020-3-3 22:53:23
答案
若夏忍冬
发表于 2020-3-4 00:07:43
yo
卜零凌
发表于 2020-3-4 10:35:53
回复
胤色之风
发表于 2020-3-4 10:59:44
感谢!
一仪已易
发表于 2020-3-4 17:25:07
T
迷路的哆啦
发表于 2020-3-4 19:15:07
0.100 1.11 2.a3.145 8 5.if(size>12)
{
cost = cost *1.25;
flag = 2;
}
else
bill = cost *flag;
if(ibex > 14)
{
sheds = 3;
}
else
{
sheds = 3;
if (score < 0)
{
printf("count = %d\n", count);
}
else
{
count++;
scanf("%d", &score);
}
help = 2*sheds
}
zhaoc1390
发表于 2020-3-4 20:45:00
。
2515504707
发表于 2020-3-4 21:16:53
11111111111111111
puluXtenth
发表于 2020-3-4 21:41:41
第十六课 捡回来!
lchxingG1
发表于 2020-3-5 11:19:02
参考答案
日均代码量为0
发表于 2020-3-5 13:14:01
111