{:10_261:}
{:5_90:}
0.10个
1.11个
2.a,b,c
3.a=14,b=5,c=9
4.z = x >= 0 ? x : -x
5.
A.
if(size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
B.
if (ibex > 14)
{
sheds = 3;
}
elae
{
sheds = 2;
}
help = 2 * sheds;
C.
while(1)
{
scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
break;
}
count++;
}
0.
#include<stdio.h>
#define PRINCIPAL 10000
#define INTEREST_S 0.1
#define INTEREST_C 0.05
int main()
{
int year;
double pri_fish = PRINCIPAL,pri_night = PRINCIPAL;
for(year = 0; pri_fish >= pri_night; year++)
{
pri_fish = PRINCIPAL * (1 + (year + 1) * INTEREST_S);
pri_night += pri_night * INTEREST_C;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",year);
printf("小甲鱼的投资额是:%.2f\n",pri_fish);
printf("黑夜的投资额是:%.2f\n",pri_night);
return 0;
}
1.
#include<stdio.h>
#define PRINCIPAL 4000000
#define COST 500000
#define INTEREST 0.08
int main()
{
int year;
double price = PRINCIPAL;
for(year = 0; price > 0; year++)
{
price -= COST;
price += price * INTEREST;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗...\n",year);
return 0;
}
2.
#include<stdio.h>
#include<math.h>
int main()
{
int i = 1;
double pi = 0,n = 1,f = pow(10,-8);
while(fabs(n) >= f)
{
pi += n;
n = pow(-1,i) * 1.0 / (2 * i + 1);
i++;
}
printf("PI 的小数点后7位近似值位:%.7f\n",4 * pi);
return 0;
}
3.
#include<stdio.h>
#define year 2
int main()
{
int month,twain1 = 1,twain2 = 1,temp;
for(month = 3; month <= 12 * year; month++)
{
temp = twain2;
twain2 += twain1;
twain1 = temp;
}
printf("两年后有%d对兔子。\n",twain2);
return 0;
}
回复查看参考答案
156
答案
我想知道答案
0、100个
1、9个
2、a = b = c
3、a = 14, b = 5, c = 9
4、z = x < 0? -x : x
5、
A.
if(size > 12)
{
cost = cpst * 1.05;
flag = 2;
}
bill = cost * flag;
B.
if(ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
C.
while(score >= 0)
{
count++;
scanf("%d", &score);
}
printf("count = %d\n", count);
回复
123
{:10_323:}
谢谢楼主
本帖最后由 GumpYu 于 2019-2-27 19:35 编辑
0:10
1:0(while 取值为0不会执行)
2: 全部都是
3: a = 14,b=9, c=5
4:x>0?x:-x;
5:if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
if (ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
}
help = 2 * sheds;
if (score < 0)
{
stage2: printf("count = %d\n", count);
}
count++;
scanf("%d", &score);
看答案
100
……
{:10_275:}
0.100
1.10
2.a,b,c
3.a =15 ,b = 5,c = 10
4.z = (x > 0)? x : -x
5.if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
else{
bill = cost * flag;
}
{:5_109:}
1