非官方认证
发表于 2016-12-3 22:53:17
求答案😃
silkworm
发表于 2016-12-4 20:55:24
哎数学不好
Hfunnychild
发表于 2016-12-4 22:02:05
做完
Blanker
发表于 2016-12-5 12:04:18
~....~b
青蛙如果
发表于 2016-12-10 23:06:40
交作业:
0、10
1、11
2、a b c
3、a = 14, b = 5,c = 9
4、
#include <stdio.h>
int main()
{
int x;
printf("请输入数字:");
scanf("%d", &x);
x = x >=0 ? x : -x;
printf("x的绝对值等于%d\n", x);
return 0;
}
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)
{
count++;
scanf("%d", &score);
}
printf("count = %d\n", count);
动动手:
0、
#include <stdio.h>
int main()
{
int fish = 10000, night = 10000, year = 0;
while(fish >= night)
{
night += night * 0.05;
fish += 10000 * 0.1;
year++;
}
printf("%d\n", year);
return 0;
}
1、
#include <stdio.h>
int main()
{
int money = 4000000, year = 0;
while(money >= 0)
{
year++;
money += (money - 500000) * 0.08 - 500000;
}
printf("%d\n", year);
return 0;
}
2、
#include <stdio.h>
int main()
{
double pi_4 = 0, oldPi_4 = 0;
int i = 0;
do
{
oldPi_4 = pi_4;
pi_4 += pow(-1, i) * (1.0 / (2 * i + 1));
i++;
}while(fabs(pi_4 - oldPi_4) > 0.00000001);
printf("%lf\n", pi_4 * 4);
return 0;
}
3、
#include <stdio.h>
int main()
{
int i = 1;
int month0 = 0, month1 = 0, month2 = 2, temp = 0;
for(; i <= 24; i++)
{
temp = month1;
month1 = month0;
month0 = month2 * 2;
month2 += temp;
}
printf("%d\n", month0 + month1 + month2);
return 0;
}
简单AI
发表于 2016-12-13 15:58:26
回复
zzhengxxiang
发表于 2016-12-16 19:14:49
10
10
abc
14,5,9
x>=0?x:-x;
if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
else bill = cost * flag;
if (ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
for (scanf("%d", &score);(score < 0);count++)
{
printf("count = %d\n", count);
}
zlj19931010
发表于 2016-12-17 18:38:46
0. 10个
1.11个
2.abc
3.b:5 c:4 a:8
4.z = x>0 ? x : -x
5.
if(size > 12){
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
B
sheds = 2;
if (ibex > 14)
{
sheds = 3;
}
help = 2 * sheds;
C
scanf("%d", &score);
while( score >= 0 ){
count++;
scanf("%d", &score);
}
printf("count = %d\n", count);
kljoij
发表于 2016-12-17 22:45:12
{:5_98:}
fatbug18
发表于 2016-12-19 18:19:56
he
kissboa
发表于 2016-12-20 21:17:17
看答案
nrliangxy
发表于 2016-12-21 17:07:04
谢谢
melor
发表于 2016-12-21 22:29:32
{:5_97:}
zealstar
发表于 2016-12-22 20:19:22
学C很艰苦啊,偶尔还是感觉到C目前还是什么也做不了的感觉。{:10_277:}
北辰制作室
发表于 2016-12-22 23:37:45
测试题
0. 10
1. 10
2. c , b ,a
3. a=14,b=5,c=9
4.
if(x < 0)
{
z = -1 * x;
}else{
z = x;
}
5.
A:
if(size > 12)
{
cost = cost * 1.05;
}else{
bill = cost * flag;
}
B:
if(ibex > 14)
{
sheds = 3;
}else{
sheds = 2;
}
help = 2 * sheds;
C:
while(scanf("%d",&score))
{
if(score < 0)
{
printf("count = %d\n",count);
break;
}
count++;
}
动动手
0.
#include <stdio.h>
#include <math.h>
int main()
{
int i = 0;
float moneyX,moneyH;
while(++i)
{
moneyX = 10000 + 10000 * i * 0.1;
moneyH = pow(1 + 0.05,i) * 10000;
if(moneyH > moneyX)
{
break;
}
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",i);
printf("小甲鱼的投资额是:%.2f\n",moneyX);
printf("黑夜的投资额是:%.2f\n",moneyH);
}
1.
#include <stdio.h>
int main()
{
int i ;
double money = 4000000;
for(i = 1, money -= 500000;money > 0;money -= 500000)
{
money += money * 0.08;
i++;
}
printf("%d年后,小甲鱼败光了所有的家产,再次回到穷光蛋。。。\n",i);
}
2.
#include <stdio.h>
#include <math.h>
int main()
{
double pi = 0,temp;
double num = 10e-8;
int n = 1,i = 0;
while(1)
{
temp = ((double)1 / n) * pow(-1,i);
if (fabs(temp) < num)
{
break;
}
pi += temp;
n += 2;
i++;
}
pi *= 4;
printf("Pi = %.7f\n",pi);
return 0;
}
3.
#include <stdio.h>
int main()
{
int j,temp1,temp2;
int num0 = 1,num1 = 0,num2 = 0; //分别代表刚出生的,出生1月,出生两月可繁殖
for (j = 1;j <=24;j++)
{
temp1 = num0; //存储上个月刚出生的兔子
temp2 = num1; //存储上个月出生1个月的兔子
num0 = num2; //本月刚出生的是上月可以繁殖兔子的数量
num1 = temp1; //出生1个月的是上月刚出生的
num2 = num2 + temp2;//出生两月以上的是之前两月的加上上个月出生1月的
}
printf("两年过后总共有%d对兔子",num0 + num1 +num2);
return 0;
}
to_is_end
发表于 2016-12-23 15:16:33
一直打印
melor
发表于 2016-12-25 16:53:43
{:5_97:}
veyoy
发表于 2016-12-26 22:19:30
{:10_266:}
小伟伟577
发表于 2017-1-4 17:13:04
0.100
1.11
2.
3.a=13,b=5,c=4
4.z=x>0?x:-x;
5A.if (size > 12)
{
cost = cost * 1.05;
flag = 2;
}
bill = cost * flag;
B.if (ibex > 14)
{
sheds = 3;
}
sheds = 2;
help = 2 * sheds;
割白菜喂猪
发表于 2017-1-5 23:13:08
地方
页:
1
2
3
4
[5]
6
7
8
9
10
11
12
13
14