xl7613
发表于 2020-4-29 11:22:39
看看
凌凌一
发表于 2020-4-29 15:01:04
111
Sonny.next
发表于 2020-4-29 15:50:58
#include <stdio.h>
int main()
{
float fish = 10000, blake = 10000;
int yers = 0;
do
{
fish = fish + 10000 * 0.1;
blake = blake + blake * 0.05;
yers = yers++;
}
while (blake < fish);
printf("%.d年后,黑夜的投资额超过小甲鱼!\n", yers);
printf("小甲鱼的投资额是:%.2f\n", fish);
printf("黑夜的投资额是:%.2f\n", blake);
}
#include <stdio.h>
int main()
{
int fish = 4000000, lx;
int cout = 0;
while (fish > 0)
{
fish = (fish - 500000) + fish * 0.08;
cout++;
}
printf("%d年之后,小甲鱼败光了所有家产,再次回到一贫如洗......\n",cout);
}
#include <stdio.h>
int main()
{
int m;
int f1 = 1, f2 = 1, fn;
int count = 1;
for(m = 1; m <= 24; m++)
{
fn = f1 + f2;
printf("第%d个月共有%d\n", count,fn);
f1 = f2;
f2 = fn;
count++ ;
}
printf("两年后一共繁殖%d只兔子\n", fn);
}
Cyeberpunk
发表于 2020-4-29 16:59:34
0.100个
1.10个
2.a b c
3.a=5b=5c=9
4.z=a>0?x:-x;
5.全部 标签后的语句放回原goto位置
0.
guard99
发表于 2020-4-29 19:58:58
0.100
1.9
2.c,b,a
3.a=14,b=5,c=9
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)
{
break;
}
count++;
}
printf("count = %d\n", count);
ggxggy
发表于 2020-4-29 22:04:31
参考答案
一抹灰
发表于 2020-4-30 09:42:22
作业写在另一台电脑了。
一悲先生
发表于 2020-4-30 10:49:23
23
BOOSGT8
发表于 2020-4-30 13:20:55
{:5_109:}
lovelysea
发表于 2020-4-30 15:12:20
6666
fredqy
发表于 2020-4-30 15:28:27
小甲鱼棒棒哒
绿甲鱼
发表于 2020-4-30 19:02:44
参考答案
guard99
发表于 2020-4-30 20:37:42
0.
#include <stdio.h>
void main()
{
float fish=10000,night=10000,df;
int i=1;
df=fish*0.1;
while(1)
{
fish+=df;
night=night*1.05;
if(night>=fish)
{
printf("%d年后,黑夜的投资超过小甲鱼!\n",i);
printf("小甲鱼的投资是:%.2f\n",fish);
printf("黑夜的投资是:%.2f\n",night);
break;
}
i++;
}
}
1.
#include <stdio.h>
void main()
{
float fish=4000000;
int i;
while(fish>0)
{
fish-=500000;
fish=fish*1.08;
i++;
}
printf("%d\n",i-1);
}
2.
#include <stdio.h>
#include <math.h>
void main()
{
int i=1;
double s=0;
while(fabs(1.0/i)>0.00000001)
{
s=s+1.0/i;
i=-1*i;
i=i>0?i+2:i-2;
}
printf("%lf\n",4*s);
}
3.
00AT00
发表于 2020-5-1 07:57:11
0. 90
1. 0
2. a, b, c
3. 14, 5, 9
4. if ( x < 0) z = -x; else z = 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(){
scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
}
一色砂糖
发表于 2020-5-1 10:53:36
学习
kuangjy
发表于 2020-5-1 17:55:47
看看
syedyj
发表于 2020-5-1 21:08:46
111
yanchunjing
发表于 2020-5-1 22:14:07
看看答案
kiliop
发表于 2020-5-2 15:32:11
kevin22
发表于 2020-5-2 18:42:47
学习