yingshao
发表于 2021-6-11 14:54:06
0:10个
1:11个
2:a,b,c
3:a=14,b =5,c =9
4:z=x>0?x:x*(-1)
5:
A;
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
break;
}
bill = cost * flag;
B:
if (ibex > 14)
{
sheds = 3;
break;
}
sheds = 2;
help = 2 * sheds;
C:
while(1)
{
readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
break;
}
count++;
}
0:
#include<stdio.h>
int main ()
{
float fish = 10000, night_sum = 10000,fish_sum= 10000;
int year;
for (year = 0; night_sum <= fish_sum; year++)
{
fish_sum = fish_sum + fish * 0.1;
night_sum= night_sum + night_sum * 0.05;
}
printf("%d年后,黑夜的投资额将超过小甲鱼!\n", year);
printf("小甲鱼的投资额是:%.2f\n", fish_sum);
printf("黑夜的投资额是:%.2f\n", night_sum);
return 0;
}
1:
#include<stdio.h>
int main()
{
float sum;
int year;
for (sum = 4000000,year = 0; sum > 0; year++)
{
sum -= 500000;
sum += sum * 0.08;
}
printf("%d年之后,小甲鱼败光了所有家产,再次回到一贫如洗……\n", year);
return 0;
}
2:
#include<stdio.h>
#include<math.h>
int main()
{
double num, num_numerator = 1, num_denominator = 1,temp = 0, sum;
int i = 0;
do
{
if (i % 2 == 0)
{
num = num_numerator / num_denominator;
}
else
{
num = -(num_numerator / num_denominator);
}
temp += num;
num_denominator += 2;
i++;
} while (fabs(num) >= 10e-8);
sum = (temp - num) * 4;
printf("PI的小数点后前7位的近似值是:%.7f\n", sum);
return 0;
}
3:
#include<stdio.h>
int main()
{
long month, new_rab, old_rab,temp, sum = 0;
for (month = 2, new_rab = 1, old_rab = 0; month <= 24; month ++)
{
temp = old_rab;
old_rab += new_rab;
new_rab = temp;
}
sum = old_rab + new_rab;
printf("两年后总共有%ld对兔子\n", sum);
return 0;
}
ameperlf
发表于 2021-6-11 16:32:23
加油
yu-ZY
发表于 2021-6-11 16:41:47
{:5_108:}
夜空中最亮的仔
发表于 2021-6-11 19:35:25
看看
梁上君子
发表于 2021-6-11 23:07:52
兔子数列
ruisen
发表于 2021-6-12 14:54:45
nb
小白的学习
发表于 2021-6-12 18:53:01
1111
lqw31123316
发表于 2021-6-12 21:47:19
1
lengyuye
发表于 2021-6-12 22:42:43
454554
kqw
发表于 2021-6-14 14:58:03
1
222scd
发表于 2021-6-14 22:08:58
111
三点氵
发表于 2021-6-15 15:43:46
不会算pi的近似值
每天2000m
发表于 2021-6-15 20:05:28
朕想知道
夏天的欢
发表于 2021-6-16 21:52:30
1
dear52gril
发表于 2021-6-17 15:40:52
chong
xieren
发表于 2021-6-17 16:12:34
答案
gaotongxue
发表于 2021-6-17 18:30:12
00
huangguohao11
发表于 2021-6-18 10:54:43
{:5_90:}
壮壮kkk
发表于 2021-6-18 21:44:09
1
wushidadi
发表于 2021-6-19 01:48:44
1