购买主题
更新啦。。
赶紧跟进~!~!~!
本帖最后由 lawry 于 2016-3-20 14:26 编辑
小甲鱼
测试题 第5题的C 答案是不是错了啊。。。
scanf(“%d”, &score);
while (score >= 0)
{
count++;
scanf(“%d”, &score);
}
printf(“count = %d\n”, count );
0. 10个
1. 0个
2. a, b, c
3. a == 14; b == 5; c == 9;
4. z = (x > 0)?x:-x
5.
A.
if (size > 12)
{
cost *= 1.05;
flag = 2;
}
else
{
bill = cost * flag;
}
B.
if (ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
help = 2 * sheds;
}
C.
while (score >= 0)
{
scanf("%d", &score);
count++;
}
printf("count = %d\n", count);
0.
#include <stdio.h>
int main()
{
float money_jia = 10000, money_hei = 10000;
int year = 0;
do
{
money_jia = money_jia + 10000 * 10 / 100;
money_hei = money_hei + money_hei * 5 / 100;
year++;
}while (money_jia > money_hei);
printf("%d年后,黑夜投资额超过小甲鱼!\n", year);
printf("小甲鱼的投资额是:%.2f\n", money_jia);
printf("黑夜的投资额是:%.2f\n", money_hei);
return 0;
}
1.
2.
动动手第3题错了吧应该是:
a = 2, b = 2;因为一对兔子有2只
参考答案算出的应该是多少对兔子吧
谢谢楼主
{:7_139:}
对答案
原来如此。。。。。
9999999999
qidai
镇乡知道
sle16
0、打印10次A 因为j在第一次循环就等于10了。
1、一次都不打啊,goto了啊?
2、左值是a
3、a=5
b=4
c=5
4、a<0?z=(-1)*a:z=a;
5、
A:
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
bill = cost * flag;
}
else
{
cost = cost * 1.05;
flag = 2;
bill = cost * flag;
}
B:
if (ibex > 14)
{
sheds = 3;
help = 2 * sheds;
}
else
{
sheds = 2;
help = 2 * sheds;
}
C:
while ( score>=0 )
{
count++;
scanf("%d", &score);
}
printf("count = %d\n", count);
动动手0
#include <stdio.h>
int main()
{
double fl,dl;
int n = 0;
dl = 10000;
fl = 10000;
while (dl>=fl )
{
n++;
dl = 10000 + 1000 * n;
fl = fl * 1.05;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n", n);
printf("小甲鱼的投资额是: %.2lf\n", dl);
printf("黑夜的投资额是:%.2lf\n", fl);
return 0;
}
sle16动动手1圆周率
#include <stdio.h>
#include <math.h>
int main()
{
double i = -3, sum=0, pi;
while ( fabs(i)<1000000000 )
{
sum = sum + ( 1 / i ) ;
if ( i<0 ){
i = fabs(i) + 2;
}
else
{
i = fabs(i) + 2;
i = -i;
}
}
pi = 4 * ( 1 + sum);
printf("pi = %.8lf\n", pi);
return 0;
}
最后结果是:pi = 3.14159265,差多少啊?
看看答案的喵
正在
0.10个A
1.0个
2.c = 5
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;
}
sheds = 2;
help = 2 * sheds;
C)if (score < 0)
{
printf("count = %d\n", count);
}
count++;
scanf("%d", &score);
0.#include<stdio.h>
#include<math.h>
int main()
{
float x,y;
int t = 1;
x = 11000;
y = 10500;
while(x > y)
{
x = 11000 + 1000 * t;
y = y * 1.05;
t++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",t);
printf("小甲鱼的投资额是:%.2f\n",x);
printf("黑夜的投资额是:%.2f\n",y);
return 0;
}
1.#include<stdio.h>
int main()
{
float x;
int t = 1;
x = 400;
while(x > 50)
{
x = (x - 50) * 1.08;
t++;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗......",t);
return 0;
}
2.#include<stdio.h>
#include<math.h>
int main()
{
double i,s,a,sum = 1;
i = 1;
s = 1;
a = 1;
while(fabs(a) >= pow(10,-8))
{
i = i + 2;
s = - s;
a = s * (1 / i);
sum = sum + a;
}
sum = sum - a;
printf("pi的值为:%.7f",sum * 4);
return 0;
}
3.#include<stdio.h>
#include<math.h>
int main()
{
int n = 3,i = 2;
int t;
for(t = 4;t <= 24;t++)
{
n = n + i;
i = i + 1;
}
printf("两年之后可以繁殖%d对兔子",n);
return 0;
}
阿斯顿
313131313131
程序不能打印出A,进入死循环。
1. 程序不能打印出B。
2. 5.
3. a=14b=3 c=9
4.
5.
A.
if (size > 12)
{
cost = cost * 1.05;
flag =2;
}
bill = cost * flag;
B.
if (ibex > 14)
{
sheds = 3;
}
help = 2* sheds;
C.
if (score <0)
{
printf("count = %d\n",count);
}
count ++;
scanf("%d",&score);
很好用
已有 12 人购买 本主题需向作者支付 10 鱼币 才能浏览