渣男团四号
发表于 2020-6-1 13:54:46
0.0
慕言·GXH
发表于 2020-6-2 16:28:02
对照
WindRoa
发表于 2020-6-2 18:11:38
0.
10次,外循环地哦啊见不满足;
1.
不会打印
2.cba
3.
a = 12
b = 4
c = 9
4.
z = -x > x? -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.
do
{
scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
}
while (1)
0.
#include <stdio.h>
int main()
{
float sum_fish = 10000, sum_black = 10000;
int year;
_Bool flag;
for (year = 0; sum_fish >= sum_black; year++)
{
sum_fish += 1000;
sum_black = 1.05 * sum_black;
}
printf("%d年后,黑夜的投资额超过了小甲鱼!\n小甲鱼的投资额是:%.2f\n黑夜的投资额是:%.2f\n", year, sum_fish, sum_black);
return 0;
}
1.
#include <stdio.h>
int main()
{
double total = 4000000;
int amount = 500000, year = 0;
while (total >= 0)
{
total -= amount;
total = 1.08 * total;
year++;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗……\n", year);
return 0;
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
double pi = 0, i = 1;
long long deno;
for (deno = 1; i / fabs(deno) > pow(10, -8); deno = -deno)
{
pi += i / deno;
deno = fabs(deno) + 2;
}
pi = 4 * pi;
printf("计算结果为:%.7f\n", pi);
return 0;
}
(不知道为什么结果不对{:5_100:})
3.
/*初始2只(qty),time为24,出生的第一对兔子假定在time为1的时候出生,故其在
* time为3的时候才可以生育;所以兔子可以存放在三个变量中
* (出生initial,发育grow,成熟breed)
* 每当time变化的时候三个变量随之变化,即当time为n的时候,
* initial(n) = breed(n-1), grow(n) = initial(n-1), bread = grow(n-1) + bread(n-1);*/
#include <stdio.h>
int main()
{
int time, initial = 0, grow = 0, bread = 2, temp;
for (time = 0; time < 24; time++)
{
temp = grow;
grow = initial;
initial = bread;
bread += temp;
}
printf("%d个月后,兔子的总数达到了%d只!\n",time, initial + grow + bread);
return 0;
}
Techniker
发表于 2020-6-2 19:16:59
0. 20
1. 无数次
2. a
3. a = 14, b = 3, c = 9
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);
DANNY-C
发表于 2020-6-3 06:07:12
答案
thy6666
发表于 2020-6-3 09:17:25
。
夜前的琉璃
发表于 2020-6-3 09:33:33
看一看
HoneyAhu
发表于 2020-6-3 17:58:57
0.100
1.11
2.a,b,c
3.a=14,b=5,c=9
4.z=x>0?x:fabs(x);
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:scanf("%d",&score);
while(score>=0)
{
scanf("%d",&score);
count++;
}
printf("count = %d\n",count);
动动手
0.#include<stdio.h>
#define sum 10000
int main()
{
double a=sum,b=sum,c=sum*0.1;
int i=0;
while(b<=a)
{
i++;
a+=c;
b=b*1.05;
}
printf("%d年后,黑夜的投资额超过小甲鱼!",i);
printf("\n小甲鱼的投资额是:%lf",a);
printf("\n黑夜的投资额是:%lf",b);
return 0;
}
1.#include<stdio.h>
#define sum 400
int main()
{
int i=0;
double n=sum;
while(n>0)
{
i++;
n-=50;
n=n*1.08;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗。\n",i);
return 0;
}
2.#include<stdio.h>
#include<math.h>
int main()
{
int sign=1;
double sum=0,n=1,i=1;
while(fabs(n)>1e-8)
{
sum+=n;
i+=2;
sign=-sign;
n=sign/i;
}
printf("%10.7lf\n",sum*4);
return 0;
}
3.
#include<stdio.h>
int main()
{
int i,sum=0;
int f1=1,f2=1,f3,f4;
for(i=2;i<=24;i++)
{
f3=f1+f2;
sum+=f3;
f1=f2;
f2=f3;
}
printf("两年后兔子的对数为:%d",sum+2);
return 0;
}
Lynn_L
发表于 2020-6-3 23:58:05
查看参考答案
theodoregao
发表于 2020-6-4 04:00:05
answers
皮强强
发表于 2020-6-4 16:58:36
10
0
大阪黑鸡
发表于 2020-6-4 20:58:56
哎
dahit
发表于 2020-6-4 21:29:50
{:10_289:}
camilo
发表于 2020-6-5 22:46:42
0.0
纵戈
发表于 2020-6-7 13:11:52
1
孤寂翁
发表于 2020-6-7 13:45:50
寡人想知道
黎明寂夜
发表于 2020-6-7 23:51:06
1
惊鸿冫梦影
发表于 2020-6-8 12:52:19
10
11
a,b,c
b=5,c=9,a=(3,4,8,14)
z = x > 0 ? x : -x
Salted,fish
发表于 2020-6-8 17:14:13
{:5_102:}
yuqijiang
发表于 2020-6-8 22:57:36
哈哈