wanary
发表于 2017-3-6 10:51:37
{:9_241:}
CHINA_AK47
发表于 2017-3-8 21:06:15
我要对标答
HUST_007
发表于 2017-3-10 20:11:30
come on!
JonTargaryen
发表于 2017-3-10 20:23:05
0. 10*10=100
1. 10
2. a
3. 9, 5, 4
4. z =
3333333e
发表于 2017-3-10 23:50:46
123
qaz505876013
发表于 2017-3-12 19:55:10
{:5_92:}
haoxingyun
发表于 2017-3-16 11:28:35
看看
屁哥
发表于 2017-3-17 16:28:31
看不懂看不懂
@小甲鱼
救命啊 课后题看不懂。。。。。
泡泡北斗星
发表于 2017-3-18 10:55:11
感觉有点难啊
Asser
发表于 2017-3-21 01:02:23
0. 100个a
1. 11个b
2. a = b; b = c; c = 5; 所以a,b,c都是l-value
3. b = 3, c = 9, a = 13
4. int x, z; z = x >= 0 ? x : -x
q944763536
发表于 2017-3-22 11:25:11
0、10次
1、0个
2、a,b,c
3、3 3 9
4、a >= 0?a:-a
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、
readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
readin: scanf("%d", &score);
动动手:
0、
什么鬼…
发表于 2017-3-23 13:24:36
0、10
1、0
2、a,b,c
3、不知道....
4、
row1990
发表于 2017-3-28 16:57:50
对答案
solitary
发表于 2017-4-2 14:33:22
朕想知道
Kotori
发表于 2017-4-2 14:35:29
0.10
1.11
2.a,b,c
3.a=14,b=4,c=10
4.z = x>=0?x:-x
5.A
if (size > 12)
{
cost =cost * 1.05;
flag =2;
}
bill = cost * flag;
B
sheds = 2;
if (ibex > 14)
{
sheds = 3;
}
help = 2 * sheds;
C
while (scanf("%d", &score) == 1)
{
if (score < 0)
{
break;
}
count++;
}
printf("count = %d\n", count);
0.
#include <stdio.h>
#include <math.h>
main()
{
double xjy, hy;
int year;
for (year=1;;year++)
{
xjy = 10000 * 0.1 * year + 10000;
hy = 10000 * pow(1+0.05, year);
if (hy>xjy)
{
break;
}
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n", year);
printf("小甲鱼的投资额是:%.2f\n", xjy);
printf("黑夜的投资额是:%.2f\n", hy);
return 0;
}
1.
#include <stdio.h>
int main()
{
double money = 400.0;
int year = 0;
while (1)
{
year++;
money = money * (1 + 0.08) - 50;
if (money < 0)
{
break;
}
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗...\n", year);
return 0;
}
2.
#include <stdio.h>
int main()
{
double pi = 0;
int num;
double temp;
for (num =1;;num++)
{
temp = 1.0 / (2 * num -1);
if (temp<0.00000001)
{
break;
}
if (num % 2 == 0)
{
pi = pi - temp;
}
else
{
pi = pi + temp;
}
}
pi= 4*pi;
printf("pi=%.7f",pi);
return 0;
}
3.
#include <stdio.h>
int main()
{
int month, last, now, temp;
for (last = 0, now = 1, month =1;month <= 24;month++)
{
temp = now;
now = now + last;
last = temp;
}
printf("%d", now);
return 0;
}
soby1984
发表于 2017-4-2 21:31:32
1
weavingliu
发表于 2017-4-3 14:27:34
来看看答案对不对
innher
发表于 2017-4-3 19:44:36
看答案
wbwstar
发表于 2017-4-3 21:25:51
0. 10
1. 10
2. --
3. 14
4. z = x<0?-x:x
5. if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
else{
bill = cost * flag;}
//-----------------------
if (ibex > 14)
{
sheds = 3;
}
else
{
sheds = 2;
help = 2 * sheds;
}
//----------------------
readin: scanf("%d", &score);
while (score > 0)
{
count++;
}
printf("count = %d\n", count);
#include <stdio.h>
int main()
{
float XJY, HY = 10000;
int year = 0;
do
{
year++;
XJY = 10000+10000*0.1*year;
HY = HY*1.05;
}
while (HY<=XJY);
printf("%d年后,黑夜的投资额超过小甲鱼!\n",year);
printf("小甲鱼的投资额是:%.2f\n", XJY);
printf("黑夜的投资额是:%.2f!\n", HY);
return 0;
}
#include<stdio.h>
int main()
{
float moneyleft = 400;
int year = 0;
while(moneyleft>0)
{
year++;
moneyleft = (moneyleft-50)*1.08;
}
printf("%d年后,小甲鱼败光了所有的家产,再次回到一贫如洗……", year);
return 0;
}
失败--#include<stdio.h>
#include <math.h>
int main()
{
float i = 1;
float x = 1;
float pi = 1;
while(fabs(x)> 0.00000001)
{
i = -(i+2);
x = 1/i;
pi = pi + x;
}
printf("pi = %.7f", 4*pi);
return 0;
}
#include <stdio.h>
int main()
{
int mon = 1;
int sum_2, sum_1 = 0;
int sum = 1;//2月前,1月前,本月
while(mon<=24)
{
sum =sum_1 + sum_2;
sum_2 = sum_1;
sum_1 = sum;
mon++;
}
printf("%d", sum_1);
return 0;
}
一轮江月明
发表于 2017-4-5 18:14:47
#include<stdio.h>
int main()
{
int m=4000000,takeout=500000,year=0;
float r =0.08;
while(m>0)
{
year++;
m = (m-takeout)*(1+r);
}
printf("%d年后,小甲鱼败光了所有家产,再次回到了一贫如洗的状态。。。",year);
return 0;
}