smgp
发表于 2017-1-7 20:32:42
已做
smgp
发表于 2017-1-8 00:42:24
求π的近似值那题为什么这样编译就不运行啊
#include <stdio.h>
#include <math.h>
int main()
{
double sum=0,i=1;
while((fabs(1/i))>1e-8)
{
sum=(1/i)+sum;
i=-(i+2);
}
sum=sum*4;
printf("Pi的近似值为%.7f",sum);
return o;
}
Hacker_Jack
发表于 2017-1-8 19:09:27
甲鱼好好好
pokerLH
发表于 2017-1-10 01:54:41
谢谢
Simon2934
发表于 2017-1-17 16:12:15
#include <stdio.h>
#include <stdlib.h>
int main()
{
float jia=10000,hei=10000;
int i=0;
while(1){
jia=jia+10000*0.1;
hei=hei*1.05;
i=i+1;
if(hei>jia){
printf("%d年后,黑夜的投资额超过了小甲鱼。\n",i);
printf("小甲鱼的投资额是%.2f\n",jia);
printf("黑夜的投资额是%.2f\n",hei);
break;
}
}
}
hexiangrong
发表于 2017-1-21 09:05:29
学习学习
hexiangrong
发表于 2017-1-21 09:05:29
学习学习
re-born
发表于 2017-1-26 20:47:07
本帖最后由 re-born 于 2017-1-26 21:17 编辑
0,10个
1,个
2,a=b,b=c,c=5, a b c
3,a=30,b=3,c=14
4,z=x>0?x:-x;
5,if (size>12)
{
cost=cost81.05;
flag=2;
}
else
{
bill=cost*flag;
}
B
sheds>14?3:2;
help=2*sheds;
Cif(score<0)
{
printf("count=%d\n",count);
}
count++;
scanf("%d",&score);
呆萌的三百块
发表于 2017-1-31 15:14:01
Q-Q
KlausPython
发表于 2017-2-3 23:41:16
daan
797
发表于 2017-2-5 23:30:05
朕想知道
自由深渊
发表于 2017-2-11 13:57:35
qqqqqqqqqqqqqqqq
就是杨小叨
发表于 2017-2-16 19:46:59
0. 10个A 逗号表达式取的是j!=10
1. 不会打印B 因为while(0)就没有进入循环
2. a,b,c都是吧
3.14;5;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);
lies_for_L
发表于 2017-2-18 22:05:12
0.程序有误,for()i = 0; i = 10, j != 10; i++)时打印10个
1.10个
2.a
3.b = 3,c = 9,
4.z = x > 0 ? x : -x;
5.A.if(size > 12)
{
cost = cost * 1.05;
flag = 2;
}
else
{
bill = cost * flag;
}
B.if(ibex > 14)
{
sheds = 3;
}
else
{
help = 2 * sheds;
}
sheds = 2;
C.if(score < 0)
{
printf(“count = %d\n”, count);
}
count++;
scanf(“%d”,&score);
0.#include <stdio.h>
#include <math.h>
int main() {
float a, b;
int i = 1;
while (a > b) {
a = 10000 * (1 + 0.1 * i);
b = 10000 * pow((1 + 0.05), i);
i++;
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n小甲鱼的投资额是:%.2f\n黑夜的投资额是:%.2f", i - 1, a, b);
return 0;
}
1.#include <stdio.h>
#include <math.h>
int main() {
int year = 1, a;
while (a > 0) {
a = ((4000000 * (1 + 0.08 * year)) - (500000 * year));
year++;
}
printf("%d年之后,小甲鱼败光了所有的家产,再次回到一贫如洗.....", year);
return 0;
}
剩下的实在是太难了啊
迷失山林
发表于 2017-2-21 15:09:01
课后测试题及答案
sd小舅子
发表于 2017-2-22 13:05:57
搞定……
kobe3477
发表于 2017-2-22 23:11:08
期待
bin2yx
发表于 2017-2-27 21:51:31
朕要看
沉默的教父
发表于 2017-2-28 20:39:28
```
@simple@
发表于 2017-3-1 11:00:59
0.10个
1.11个
2.a,b,c
3.a = 16,b = 6,c = 10;
4.
if(x>0)
{
z = x;
}
else
{
z = -x;
}
5.
A.
if(size > 12)
{
const = const * 1.05;
flag = 2;
}
bill = cost *flag;
B.
if(ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
C.
count++;
scanf("%d",&score);
if(score < 0)
{
printf("count = %d\n",count);
}
页:
1
2
3
4
5
[6]
7
8
9
10
11
12
13
14
15