多学多看
发表于 2024-4-16 22:45:43
1
R0se
发表于 2024-4-17 22:15:59
哈哈
萌新勇闯嵌入式
发表于 2024-4-18 11:02:11
疯狂的兔子
19800324
发表于 2024-4-23 19:42:26
1
LHX2
发表于 2024-4-23 20:27:39
看答案
Godofwar
发表于 2024-4-24 13:54:28
1
pfqysdrzbr
发表于 2024-4-27 14:19:08
1
天马流星拳
发表于 2024-4-27 14:30:05
10;0;c=5,b=c,a=b;9,4,3;z = fabs(x);biubiubiu
18434829860
发表于 2024-5-2 17:16:20
1
PisoN
发表于 2024-5-5 21:26:11
加油!
overworld
发表于 2024-5-7 20:52:38
ck
虞寒立
发表于 2024-5-8 13:38:15
1
少女单刀猎人
发表于 2024-5-10 07:59:53
1
LLLLLUO
发表于 2024-5-10 17:33:45
👀
vectorfunction
发表于 2024-5-11 15:27:38
测试题
0.10个
1.0个
2.c, b, a
3.14,5,9
4. z = (a >= 0) ? a : 0 - a;
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 (1)
{
scanf("%d", &score);
if (score < 0)
{
break;
}
count++;
}
printf("count = %d\n", count);
动动手
0.
#include <stdio.h>
int main()
{
double jia, hei;
jia = 10000, hei = 10000;
int year = 0;
while (jia >= hei)
{
jia += 10000 * 0.1;
hei *= 1.05;
year++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",year);
printf("小甲鱼的投资额是:%.2f\n",jia);
printf("黑夜的投资额是:%.2f\n",hei);
return 0;
}
1.
#include <stdio.h>
int main()
{
double money = 400;
int year = 0;
while (money >= 0)
{
money -= 50;
money *= 1.08;
year++;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗......",year);
return 0;
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
double pi4 = 0.0;
double pi;
double mu = 1.0;
double cha = 1.0;
double a = -1.0;
const double f = pow(10, -8);
//printf("%.8f\n", f);
while (cha > f)
{
a = -a;
pi4 = pi4 + a / mu;
mu += 2;
pi = pi4 * 4;
cha = fabs(pi - 3.14159265);
//printf("%.8f\n",cha);
}
printf("pi的近似值是:%.9f",pi);
return 0;
}
3.
#include <stdio.h>
int main()
{
int month, da, x0, x1;//月份,大兔子,0个月兔子,1个月兔子
int num = 0;
da = 1;
x0 = 0, x1 = 0;
for (month = 0; month < 24; month++)
{
da += x1; //1兔子长大
x1 = x0; //0兔子长大
x0 = da; //大兔子生0兔子
}
num = da + x1 + x0;
printf("两年之后,兔子数量为:%d",num);
return 0;
}
Tchaikov_Hoo
发表于 2024-5-12 08:56:58
又学到了新的函数——fabs。
Itszhazha
发表于 2024-5-14 10:18:26
111
Longlong96
发表于 2024-5-15 22:27:50
1
学不会.C
发表于 2024-5-17 14:54:21
{:5_90:}
王乾坤
发表于 2024-5-17 17:44:35
5 10 a,b,c