月影随风
发表于 2020-10-3 15:05:53
参考答案
Teriri丶
发表于 2020-10-3 15:18:12
。
夕慕一兮
发表于 2020-10-3 15:34:26
测试题
0、10。
1、10.
2、c,b,a
3、a=14,b=5,c=9
4、z=(x>=0)?x:-x;
5、A、if (size > 12)
{
cost *= 1.05;
flag = 2;
}
bill = cost * flag;
B、if(ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
}
help = 2 * sheds;
C、scanf("%d",&score);
while(score >= 0)
{
count++;
scanf("%d", &score);
}
printf("count = %d\n", count);
动动手
0、#include <stdio.h>
#define BENJIN 10000
#define DAN0.1
#define FU0.05
int main(void)
{
int year;
float jia = 10000;
float hei = 10000;
for(year = 1; jia >= hei; year++)
{
jia = (BENJIN + BENJIN * DAN * year);
hei = hei * FU + hei;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",year-1);
printf("小甲鱼的投资额是:%.2f\n", jia);
printf("黑夜的投资额是:%.2f\n",hei);
return 0;
}
1、#include <stdio.h>
#define BENJIN 400
#define HONGLI 0.08
int main(void)
{
int year;
float jia = BENJIN;
for(year = 1; jia > 0; year++)
{
jia = jia - 50;
jia = jia * HONGLI +jia;
}
printf("%d年后,小甲鱼败光了所有的家产,再次回到一贫如洗...\n", year - 1);
return 0;
}
2、#include <stdio.h>
int main(void)
{
double zhi = 0;
int i;
int flag = 1;
for(i = 1; zhi >= 1.0e-8; i += 2)
{
zhi = zhi + 1 / i * flag;
flag = -flag;
}
printf("PI = %.7f\n", zhi*4);
return 0;
}
3、#include <stdio.h>
int main(void)
{
long num = 2;
int i;
for(i = 2; i <= 12; i++)
{
num = num * 2;
}
printf("num = %ld\n", num);
return 0;
}
limitbreak
发表于 2020-10-3 16:11:09
0.10
1.11
2.a,b,c
3.3, 9, 14
4.
5.
#include <stdio.h>
int main() {
int size;
float bill, flag, cost = 0.00;
for (size = 0; size <= 50; size++)
{
if (size > 12)
{
cost *= 1.05;
flag = 2;
}
else
{
bill = cost * flag;
}
}
return 0;
}
#include <stdio.h>
int main()
{
int ibex, sheds, help;
for (ibex = 0; ibex <= 50; ibex++)
{
if (ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
help = 2 * sheds;
}
}
return 0;
}
#include <stdio.h>
int main()
{
int score, count;
for (count = 0; count <= 50; count++)
{
scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
}
return 0;
}
0.
#include <stdio.h>
#include <math.h>
void main()
{
float year = 0, P = 10000, F1, F2;
float i1 = 0.1, i2 = 0.05;
do
{
year++;
F1 = P * (1 + year * i1);
F2 = P * pow((1 + i2),year);
}while (F2 < F1);
printf("%.0f年后,黑夜的投资额超过小甲鱼\n", year);
printf("小甲鱼的投资额是: %.2f\n", F1);
printf("黑夜的投资额是: %.2f\n",F2);
hanxida
发表于 2020-10-3 18:32:00
。
lsy358027330
发表于 2020-10-4 18:36:59
{:5_106:}太难了吧,最后一个
gfnch
发表于 2020-10-4 19:03:07
查看参考答案
一——一
发表于 2020-10-4 19:46:13
1
黑眼睛
发表于 2020-10-4 20:08:15
1.100
2.90
3.a.b.c
4.
5.int flag=2
if (size > 12)
{ cost = cost*1..05
}
else
{
bill = cost * flag
}
miniArce
发表于 2020-10-5 12:27:55
zu
牛牛牛的妞
发表于 2020-10-5 21:22:51
答案
秦筱榆
发表于 2020-10-6 20:43:43
0.109
1.11
2.a
3.a5 b5 c9
4.
if(x>=0)
z=x;
else
z=-x;
5.
//A.
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
//B.
if (ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
//C.
while(1)
{
readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
}
小毛驴上高速
发表于 2020-10-7 16:04:24
0、100次
1、0次
2、abc
3、 14 5 9
4、z =(x<0?fabs(x),x)
5、
东方惨败
发表于 2020-10-7 18:20:46
做出来啦
wobic
发表于 2020-10-7 21:24:42
123
kopshin3
发表于 2020-10-7 22:55:37
答案
刘小凯
发表于 2020-10-7 23:22:34
hh
jiecaonengchima
发表于 2020-10-7 23:29:00
T0、
10个A
T1、
0个B
T2、
c
b
a
T3、
b=3;→b=4;→b=5;
c=8;→c=9;
a=14;
T4、
#include <stdio.h>
int main()
{
int z,x;
printf("请输入一个整数:");
scanf("%d",&x);
z=x>=0?x:-x;
printf("z=%d\n",z);
return 0;
}
T5、
A:
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
B:
if (ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
}
help = 2 * sheds;
C:
#include<stdio.h>
int main()
{
int score,count;
while(1)
{
scanf("%d", &score);
if (score<0)
{
printf("count = %d\n",count);
}
count++;
}
return 0;
}
Q0、
#include <stdio.h>
int main()
{
float xjy,black;
int count;
xjy=10000;black=10000;
while (black<=xjy)
{
xjy=xjy+10000*0.1;
black=black*1.05;
count++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",count);
printf("小甲鱼的投资额是:%.2f",xjy);
printf("黑夜的投资额是:%.2f",black);
return 0;
}
Q1、
#include <stdio.h>
int main()
{
float zandaka=400;
int count;
while(zandaka>0)
{
zandaka=zandaka-50;
if (zandaka>0)
{
zandaka=zandaka*1.08;
count++;
}
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗...",count);
return 0;
}
Q2、
#include <stdio.h>
#include <math.h>
int main()
{
long long fenzi=1;
double fenmu=1;
double xiang,sum,pai;
for(fenmu=1;fenmu<pow(10,8);fenmu=fenmu+2)
{
xiang=fenzi/fenmu;
sum=sum+xiang;
fenzi=-fenzi;
}
pai=sum*4;
printf("π的小数点后7位是:%.7f\n",pai);
return 0;
}
Q3、
#include <stdio.h>
#include <math.h>
int main()
{
long long RabbitNum=2,birthnum;
int month;
for (month=2;month<=24;month++)
{
birthnum=RabbitNum;
RabbitNum=RabbitNum+birthnum;
}
printf("2年后可以繁殖%lld对兔子,共有%lld对兔子",(RabbitNum-2)/2,RabbitNum/2);
return 0;
}
看清之后才看轻
发表于 2020-10-8 19:07:49
。。。
smallyuan
发表于 2020-10-10 08:36:24
ok