嘴角微微上扬
发表于 2020-12-13 09:14:11
查看参考答案
Superhomme
发表于 2020-12-13 15:16:59
对答案
5566778899
发表于 2020-12-13 17:28:25
0 ;100
1;0 (i++是先判断再增加 ++i是先加1再判断)
2;c = 5; b = c;a = b;
3;b=5 c= 5
4;if (x>=0) z = x;
else z = -x;
5A;if (size > 12)
{ cost cost*1.05;flag = 2;}else{bill = cost*flag;}
B;
if sheds = 3;else shed =2 ; help = 2* sheds;
c;
while(1)
{
scanf("%d", &score);
if (score < 0)
{printf("count = %d\n", count);break;}
count++;
}
育人三代
发表于 2020-12-14 17:10:05
朕想知道
pop智慧树
发表于 2020-12-14 19:42:26
十分感谢
happydogzjk
发表于 2020-12-14 22:11:59
0:int main()
{
int i=10000,year=0;
double rate1=0.1,rate2=0.05;
double result1=0,result2=1;
while(++year)
{
result1=i+i*rate1*year;
result2=result2*(1+rate2);
// printf("year=%d,result1=%.2f,result2=%.2f\n",year,result1,i*result2);
if (i*result2>result1)
{
//printf("year=%d,result1=%.2f,result2=%.2f\n",year,result1,i*result2);
break;
}
}
printf("%d年后,黑夜的投资超过小甲鱼!\n");
printf("小甲鱼的投资额是:%.2f\n",result1);
printf("黑夜的投资额是:%.2f",result2*i);
return 0;
}
zaphkiel
发表于 2020-12-15 13:19:48
太难了
猫和狼
发表于 2020-12-15 13:32:12
回复
Kasileo
发表于 2020-12-15 15:07:52
11111111111
李古拉斯百奇
发表于 2020-12-15 16:06:29
#include <stdio.h>
int main()
{
int x;
int z;
printf("请输入一个整数:");
scanf("%d",&x);
z = x >= 0 ?x : -x;
printf("绝对值是%d",z);
}
ChokerQ
发表于 2020-12-16 13:45:13
一时之快
皓皓原来不太俊
发表于 2020-12-17 04:00:33
=。=
1296657603a
发表于 2020-12-17 14:27:56
【】平平平平平平平平
努力学c的小汪
发表于 2020-12-17 22:44:24
1
Aruuuu
发表于 2020-12-18 12:40:15
小测试:
0. 10个‘A'
1.10
2. a
3. a=15 b=5c=10
4. x>=0 ? z=x : 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:
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
scanf("%d", &score);
动动手:
0.
#include <stdio.h>
#define INI 10000
int main()
{
float f=INI,d=INI;
int count=0;
do
{
f += INI * 0.1;
d += d * 0.05;
count = count + 1;
}
while ( f >= d );
printf("%d年后,黑夜的投资额超过了小甲鱼!\n",count);
printf("小甲鱼的投资额是:%.2f\n",f);
printf("黑夜的投资额是:%.2f\n",d);
return 0;
}
1.
#include <stdio.h>
int main()
{
int year=0;
float m=400;
do
{
year += 1;
m -= 50;
m *= 1.08;
} while ( m>0 );
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗……\n",year);
return 0;
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
double result=0,i;
int n;
_Bool f=1;
for ( n = 1; n < pow(10,8); n +=2 )
{
i = 1.0 / n;
switch (f)
{
case 1: f = 0; break;
case 0: i = -i; f = 1; break;
}
result += i;
}
printf("pi = %.7f\n",result*4);
return 0;
}
3.
#include <stdio.h>
int main()
{
int m,b1=1,b2=0,b3,sum=0;
sum = b1 + b2;
for ( m = 3; m <= 24; m++ )
{
b3 = b1 + b2;
sum = sum + b3;
b2 = b3;
b1 = b2;
}
printf("两年后,共有%d只兔子\n",sum);
return 0;
}
GGQ233
发表于 2020-12-19 13:28:16
1
瞪太阳
发表于 2020-12-19 13:52:38
0. 10个A
1. 10个B
2. a
3.5,9,5
4.x>=0?z=x:z=-x;
5.A.
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
bill = cost * flag;
}
bill = cost * flag;
B.
if (ibex > 14)
{
sheds = 3;
help = 2 * sheds;
}
sheds = 2;
help = 2 * sheds;
C.
scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
else
{
count++;
scanf("%d", &score);
printf("count = %d\n", count);
}
佳奕来划水
发表于 2020-12-19 22:17:24
回复
Python操作专员
发表于 2020-12-20 22:30:18
lhx07
发表于 2020-12-21 15:37:07
0.10
1.0
2.a
3.a=5,b=5,c=9
4.z=x>=0?x:-x
5.
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.
while(scanf("%d",&score))
{
if(score>=0)
{
count++;
}
}
printf("count=%d\n",count);
0.
#include <stdio.h>
int main()
{
float money_jiayu=10000;
float money_heiye=10000;
float sum_jiayu=money_jiayu*1.1;
float sum_heiye=money_heiye*1.05;
int n=1;
for(n=1;sum_jiayu>=sum_heiye;n++)
{
sum_jiayu=sum_jiayu+money_jiayu*0.1;
sum_heiye=sum_heiye*1.05;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",n);
printf("小甲鱼的投资额是:%.2f\n",sum_jiayu);
printf("黑的的投资额是:%.2f",sum_heiye);
return 0;
}
1.
#include <stdio.h>
int main()
{
float sum=400,r=0.08;
float out=50;
int n=1;
do
{
sum=(sum-out)*(1+r);
n++;
}while(sum>out);
printf("%d年之后,小甲鱼败光了所有家产,再次回到一贫如洗......\n",n);
return 0;
}