梅波来学c
发表于 2020-7-27 22:55:38
加油
呼哧呼哧拔萝卜
发表于 2020-7-27 23:09:45
{:5_90:}
我变秃了。
发表于 2020-7-28 04:28:57
0
17773273991
发表于 2020-7-28 14:32:57
1
magicianLZ
发表于 2020-7-28 16:41:34
gogogogo
hi我的世界
发表于 2020-7-28 17:13:31
#include<stdio.h>
int main()
{
float a=10000,b=10000,sum1,sum2;
for(int i=1;i<=b;i++)
{
sum1=a+(a*0.1)*i;
sum2=b*(1+0.05)*i-b;
if(a<b)
{
printf("%d年后,黑夜的投资额超过小甲鱼!",i);
printf("小甲鱼的投资额:%.2f",sum1);
printf("黑夜的投资额是:%.2f",sum2);
break;
}
}
return 0;
}
hi我的世界
发表于 2020-7-28 17:22:36
#include<stdio.h>
int main()
{
double money=4000000;
int count=0;
while(money>=0)
{
money-=500000;
money+=0.08*money;
count++;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗",count);
return 0;
}
hi我的世界
发表于 2020-7-28 17:29:13
#include<stdio.h>
int main()
{
long a=1,b=1,c,i;
for(i=3;i<=24;i++)
{
c=a+b;
a=b;
b=c;
}
printf("两年后,总共有%ld只兔子!\n",c);
return 0;
}
xuexi2020
发表于 2020-7-28 20:03:19
{:9_241:}
Eval.lhq
发表于 2020-7-28 23:13:32
1
yasyd
发表于 2020-7-29 11:16:07
1
旋转小代码
发表于 2020-7-29 14:05:00
ideasim
发表于 2020-7-29 14:25:12
1
AizenSousuke
发表于 2020-7-29 14:37:01
a
liangzichaoxi
发表于 2020-7-29 18:08:21
测试题:
0.
10个
1.
0个
2.
a,b,c
3.
14,5,9
4.
#include <stdio.h>
int main()
{
intx, z;
scanf("%d", &x);
z= x>=0 ? x: -x;
printf("z=|x|=%d\n", z);
return 0;
}
5.
A.
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
B.
if (ibex > 14)
{
sheds = 3;
help = 2 * sheds;
}
else
{
sheds = 2;
sheds = 3;
help = 2 * sheds;
}
C.
do
{
scanf("%d", &score);
if(score>=0)
{
count++;
}
}while(score>=0)
printf("count = %d\n", count);
动动手:
0.
#include <stdio.h>
int main()
{
float xjy=10000, hy=10000, lx1, lx2;
int count=0;
while(hy<=xjy)
{
lx1=10000*0.1;
lx2=hy*0.05;
xjy=xjy+lx1;
hy=hy+lx2;
count++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",count);
printf("小甲鱼的投资额是:%.2f\n",xjy);
printf("黑夜的投资额是:%.2f\n",hy);
}
1.
#include <stdio.h>
int main()
{
float zh=400;
int count=0;
while(zh>0)
{
zh=zh-50;
zh=zh+zh*0.08;
count++;
}
printf("%d年后,小甲鱼败光了所有家产,再次回到一贫如洗…",count);
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
float pi1=1, pi2;
int c=1, i=-1;
do
{
c=c+2;
pi1=pi1+i*1.0/c;
i=-i;
pi2=4*pi1;
}while(1.0/c >= pow(10, -8));
printf("pi=%.7f", pi2);
}
3.
#include <stdio.h>
int main()
{
int count=0, i1=1, i2=0, i3=0, rb=2;
i3=i1;
count++;
while(count<=24)
{
i1=i1+i2;
i2=i3;
i3=i1;
rb=i1+i2+i2;
count++;
}
printf("两年后共有兔子%d对", rb);
}
ChiaKiNanami
发表于 2020-7-29 21:28:00
111
wyschenhang
发表于 2020-7-29 23:09:58
a
飞翔的小巨人
发表于 2020-7-30 17:08:00
学习学习
alexvictory
发表于 2020-7-31 12:31:37
答案
cheserio
发表于 2020-7-31 16:12:06
1