123
0.100
1.10个‘B’
2.c = 5 -> c;b = c -> b;a = 5 -> a
3.a = 14,b = 5,c = 9
4.z = x > 0 ?x : -x
5.A :
if ( size > 12 )
{
cost *= 1.05 ;
flag = 2;
}
bill = cost * flag;
B:
if ( ibex > 14 )
{
sheds = 3 ;
}
sheds = 2 ;
help = 2 * sheds ;
C:
for ( ; scanf ( " %d , &score " ) ; count ++)
{
if ( score < 0 )
{
printf ( " count = %d \n " , count ) ;
}
}
测试题:
0 100
1 10
2
3 13 3 8
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 readin: scanf("%d", &score);
if (score < 0)
{
printf("count = %d\n", count);
}
count++;
动动手:
0 #include <stdio.h>
int main ()
{
double a,b;
int i;
for (a = 10000,b = 10000,i = 0;a >= b;i ++)
{
a = a + 10000 * 0.1;
b = b * (1 + 0.05);
}
printf("%d年后,黑夜的投资额超过小甲鱼!\n",i);
printf("小甲鱼的投资额是:%.2f元\n",a);
printf("黑夜的投资额是:%.2f元\n",b);
return 0;
}
1 #include <stdio.h>
int main()
{
double money;
int i;
for (money = 400,i = 0;money >= 0;i ++)
{
money = (money - 50) * (1 + 0.08);
}
printf("%d年以后,小甲鱼败光了所有家产,再次回到了一贫如洗......\n",i);
return 0;
}
2 #include <stdio.h>
#include <math.h>
int main()
{
int flag = 1,i = 1;
double pi,sum,num = 1,x;
do
{
sum = sum + num;
pi = 4 * sum;
flag = -flag;
i = i + 2;
num = flag * num / i;
} while ((x = fabs(num)) >= 10 ^ (-8));
printf("圆周率的值是:%.7f\n",pi);
return 0;
}
3
完成
a += 3;
开开心心掉发^.^
654
答案
看还会
C把丙苯
生兔子都懵逼了,一看答案,贼简单
@小甲鱼最后一题答案代码给错了
应该是这样的,a,b=2这样才对!等于1的话前几个月结果都不对
#include<stdio.h>
int main()
{
long a=2,b=2,c,i;
for(i=3;i<=24;i++)
{
c=a+b;
a=b;
b=c;
}
printf("二年后,总共有%ld!\n",c);
return 0;
}
查看答案
查看答案
zhichixiaojiayu
参考答案
100
朕想知道
答案答案
0