李雾月
发表于 2023-3-18 21:25:42
{:7_112:}
goodlaptop
发表于 2023-3-18 22:22:42
huifu
九五学代码
发表于 2023-3-19 19:41:56
0.100次
1.11个
2.a,b,c
3.a=(3,4,9,12)
b=4
c=9
4.x>0?x:-x;
SDRAGON
发表于 2023-3-19 21:14:23
S1E16:拾遗 | 课后测试题及答案
enchantingc
发表于 2023-3-20 16:08:28
不错
wjslkka
发表于 2023-3-21 15:25:50
答案
二极管-!
发表于 2023-3-22 13:37:05
#include<stdio.h>
#include<math.h>
int main()
{
float jiayu,heiye;
int year=1;
for(jiayu=10000,heiye=10000;heiye<=jiayu;year++)
{
jiayu=10000+1000*year;
heiye=10000*pow((1.05),year);
}
printf("%d年后,黑夜投资额大于小甲鱼!\n小甲鱼投资额是:%.2f\n黑夜投资额是:%.2f\n",year,jiayu,heiye);
return 0;
}
Little_Prince
发表于 2023-3-22 17:17:49
测试题
0.10
1.不输出,如果开始给i赋值为1,则可以输出”BBBBBBBBB“
2.a,b,c
3.14,5,9
4.x > 0 ? x: -x;
5.
A.
if (size > 12)
{
cost = cost * 1.05;
}
bill = cost * flag;
flag = 2;
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++;
}
动动手
0.
#include <stdio.h>
int main()
{
double fish = 10000, night = 10000;
int i = 0;
for(i = 0; fish >= night; i++)
{
fish = fish + 10000 * 0.1;
night = night * (1 + 0.05);
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n", i);
printf("小甲鱼的投资额是:%.2f\n", fish);
printf("黑夜的投资额是:%.2f\n", night);
return 0;
}
1.
int i = 0;
double fish = 4000000;
for(i = 0; fish >=0; i++)
{
fish -= 500000;
fish = fish * (1 +0.08);
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗……\n", i);
2.
int i = 1;
double Pi = 0;
for(i = 1; i <= 10000000; i++)
{
if(i % 2 == 1)
{
Pi += (1.0000000 / (2 * i - 1));
}
else
{
Pi += (1.0000000 / -(2 * i - 1));
}
}
printf("Pi = %.7f", 4 * Pi);
3.
int month = 3;
int i = 1,j = 1;
long long int num = 0;
for(month = 3; month <= 24; month++)
{
num = i + j;
i = j;
j = num;
}
printf("两年之后共有%d对兔子\n", num);
海鱼ccc
发表于 2023-3-22 20:04:07
..
时十陵
发表于 2023-3-22 22:39:16
朕想知道
雪诺斯
发表于 2023-3-22 23:53:48
6
silver-crow
发表于 2023-3-23 13:50:37
1
silver-crow
发表于 2023-3-23 13:56:01
1
15945632454
发表于 2023-3-23 22:46:55
d咸鱼
发表于 2023-3-24 11:54:57
666
杨鑫荧
发表于 2023-3-27 18:34:09
22
喳喳啾啾
发表于 2023-3-27 19:22:06
0.100
1.10
2.不会
3.c=10
b=3
a=15
4.z=(-x&&x)
5.3.while((scanf("%d",&score))==1)
{
if(score<0)
{
printf("count=%d\n",count);
count++;
}
}
夏季的春秋
发表于 2023-3-28 16:37:05
加油
duanjunyi
发表于 2023-3-29 02:26:12
啊
昨日嘉靖
发表于 2023-3-30 00:01:09
1