|
发表于 2024-8-20 18:23:07
|
显示全部楼层
0.11次
1.哈哈刚错过, 0 次!
2.a b c都是
3. b=3 b=4 c=9? c=10 b=5 a=15? 感觉不对
4.
#include <stdio.h>
int main()
{
int i;
printf("请输入一个数");
scanf_s("%d", &i);
if (i < 0)
{
i = -i;
}
printf("i 的绝对值是 :%d", i);
return 0;
}
5.
A.
int size, flag, cost, bill;
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)
{
printf("请输入数字:");
scanf_s("%d", &score);
if (score < 0)
{
break;
}
count++;
}
printf("count = %d\n", count);
0.
#include <stdio.h>
//本金 principal 利息 interest
int main()
{
int count = 0,a;
double Money1 = 10000.0, Money2 = 10000.0;
a = 0.1 * Money1;
printf("%lf,%lf\n", Money1, Money2);
while (Money1 >= Money2)
{
Money1 += a;
Money2 *= 1.05;
count++;
printf("%d %.2lf %.2lf\n", count, Money1, Money2);
}
printf("过了%d年,小甲鱼%.2lf元,黑夜%.2lf元", count, Money1, Money2);
return 0;
}
1.
#include <stdio.h>
int main()
{
float Money = 4.0e+6;
int yers = 0;
while (Money > 0)
{
Money -= 5.0e+5;
Money *= 1.08;
yers += 1;
printf("还剩余%e元\n", Money);
}
printf("%d\n", yers);
return 0;
}
2.
#include <stdio.h>
int main()
{
float fz = 1.0, fm = 1.0;
double i = 0, result = 0;
while (1)
{
i = ((fz / fm) - (fz / (fm + 2)));
result += i;
printf("%lf\n", i);
fm += 4;
if (i<1.0e-12)
{
break;
}
}
printf("pi约等于%lf\n", result*4);
return 0;
}
3.
#include <stdio.h>
int main()
{
long long int nums = 2, mu1 = 0, mu2 = 0,a;
int time = 1,zt = 1;
while (time <= 24)
{
time++;
a = nums;
nums += mu2;/////////////////
mu2 = mu1;
mu1 = a * 2;
printf("%d %d %d\n", nums, mu1, mu2);
}
printf("共有%lld\n", nums+mu1+mu2);
return 0;
}
|
|