电控渣
发表于 2022-1-16 16:09:31
黑续修
mu61
发表于 2022-1-16 16:25:30
0. 100
1. 10
2. cba
3. 14,5,9
4. x>0 ? z=x : z=-x;
5.
A
if (size > 12)
{
cost *= 1.05;
flag = 2;
}
else bill = cost * flag;
B
if (ibex > 14) sheds = 3;
else
{
sends = 2;
help = 2 * shends;
}
C
while (1)
{
scanf("%d", &score);
if (score < 0) break;
count ++;
}
printf("count = %d\n", count);
0.
#include <stdio.h>
int main()
{
float money_xjy = 10000.0, money_hy = 10000.0;
int year=0;
while (1)
{
money_xjy += 10000 * 0.1;
money_hy += money_hy * 0.05;
year ++;
if (money_hy > money_xjy) break;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n", year);
printf("小甲鱼的投资额是:%.2f\n", money_xjy);
printf("黑夜的投资额是:%.2f\n", money_hy);
return 0;
}
1.
#include <stdio.h>
int main()
{
int xjy=400, year=1;
while (1)
{
xjy -= 50;
if (xjy <= 0) break;
xjy += xjy * 0.08;
year ++;
}
printf("%d年后,小甲鱼再次白手起家...\n", year);
return 0;
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
double pi=0;
int temp=1, i= -1;
while (1)
{
pi += (1.0 / (double)temp);
if (fabs(1.0 / (double)temp) < 0.00000001) break;
temp = i * (fabs(temp) + 2 );
i = -i;
}
pi *= 4.0;
printf("pi = %.7f\n", pi);
return 0;
}
3. 用奇怪的方法列出斐波那契数列咩。。。
#include <stdio.h>
int main()
{
int result, adult=0, young=0, teen=1, month=1;
for(month=2; month<=24; month++)
{
adult += young;
young = teen;
teen = adult;
result = adult + young + teen;
}
result = adult + young + teen;
printf("共有兔子%d对\n", result);
return 0;
}
4.鱼老师那个 fabs-求绝对值 点不进去,是不是链接该更新啦。。
dfenc
发表于 2022-1-16 20:58:56
8
shenqiqishi
发表于 2022-1-16 20:59:54
0. 100个
1.11个
2.a, b, c ,
3.a =14 ,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 ;
}
sheds = 2 ;
help = 2 * sheds ;
C.
if (score < 0 )
{
printf("count = %d\n",count);
}
count ++;
scanf ("%d",& score );
0.
#include<stdio.h>
int main()
{
float tur = 10000,bla = 10000 ;
int i ;
for (i = 1 ; ; i ++)
{
bla = bla * 0.05 + bla ;
if (bla > tur * 0.1 * i + tur)
{break;}
}
tur = tur * 0.1 * i + tur ;
printf("%d年后,黑夜的投资额超过小甲鱼!\n",i);
printf("小甲鱼的投资额是 : %.2f\n",tur);
printf("黑夜的投资额是 : %.2f\n",bla);
return 0 ;
}
1.
#include<stdio.h>
int main()
{
int i;
float awa = 400;
for(i = 0 ; awa>= 0 ; i++)
{
awa = awa-50 + (awa-50) * 0.08 ;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗···\n",i );
return 0 ;
}
2.
#include<stdio.h>
#include<math.h>
int main()
{
double i ;
int j = -1 ;
long double qua_pi = 1 ,pi;
for (i = 3 ; ; i += 2)
{
if(1/i< pow(10,-8))
{break;}
qua_pi =( 1/i) * j+ qua_pi;
j = -j;
}
pi = qua_pi * 4 ;
printf("Pi的近似值为%.7Lf\n",pi);
return 0 ;
}
3.
#include<stdio.h>
int main()
{
int i ;
int j = 1 ;
int k = 1 ;
_Bool adu;
for (i = 0 ; i < 24; i++)
{
adu = 0;
k += 2;
if (k - i == 2)
{
adu = 1;
k = i ;
}
if (dua)
{
j ++ ;
}
}
return 0 ;
}
肘子先生
发表于 2022-1-17 21:57:42
1
suoyuanjiede
发表于 2022-1-18 18:12:47
,
轮回之翼
发表于 2022-1-19 17:26:42
好难啊!!!QAQ
li691155670
发表于 2022-1-19 20:16:08
1.9个
2,变量a
3.a=13,b=9,c=4
4:z=x>0?X:-x
5:if(size>12)
{
cost=cost*1.05
flag=2;
}
else
bill=cost*flag;
return 0;
if (ibes>14)
{
sheds=3;
}
sheds=2;
help=2*sheds;
C:
if(score<0)
{
printf("count=%d\n",count);
}
count ++;
scanf("%d",&score);
程员新秀
发表于 2022-1-20 01:05:03
1
付龙鑫
发表于 2022-1-20 10:35:47
测试
0.10个
1.0个
chaoyang.xu
发表于 2022-1-20 15:34:37
danan
Nayuta1
发表于 2022-1-20 16:10:41
12
mazhiwei296
发表于 2022-1-23 02:25:50
查看参考答案
willicn663
发表于 2022-1-23 11:03:08
甲鱼快给我看答案否则炖了你
lym3002
发表于 2022-1-23 16:03:53
.
阿斯顿飞行局
发表于 2022-1-23 16:12:17
1
昼与夜
发表于 2022-1-23 21:37:49
想看
boluohmx
发表于 2022-1-24 09:49:05
看看答案
李寻欢2333
发表于 2022-1-24 16:47:18
有点难搞
我要进大厂!
发表于 2022-1-24 21:05:51
坚持