么么哒小甲鱼
I love FishC.com!
12
over
坚持胜利
2
1
难受
看答案
0.10
1.0
2.5
3.出错
.
0.10次
1.10次
2.c,b,a
3.a=4,b=5,c=9
4.x>=0?z=x:z=0-x;
5.
看看
看看
答案
本帖最后由 ietar 于 2019-6-29 10:53 编辑
0
just 10
1
...没进循环啊
2
a
3
b=3,c=8 b=4 c=9 b=5 a=14
4
void main(){
float x,z;
printf("x=:");
scanf("%f",&x);
z = x>0?x:-x;
printf("z=%f",z);
}
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>
void main(){
int year;
const float i1=0.1;
const float i2=0.05;
double xjy=10000, heiye=10000;
for(year=0;heiye<=xjy;year++){
xjy += 10000*i1;
heiye *= (1+i2);
}
printf("after %d years, heiye gets more than xjy!\n",year);
printf("xjy:%.2f\nheiye:%.2f",xjy,heiye);
}
1
#include <stdio.h>
void main(){
int year;
double base = 4000000;
for(year=0;base>=0;year++){
base -= 500000;
base *= 1.08;
}
printf("after %d years, sjy sucks!\n",year);
}
2
#include <stdio.h>
#include <math.h>
void main(){
double qpi=0,each=1;
int n,count=0;
for(n=1;fabs(each)>=1e-8;n++){
each = pow(-1,(n+1))/(2*n-1);
qpi += each;
count += 1;
}
printf("pi=%.7f\ncount=%d",4*qpi,count);
}
这tm循环了5000万零1次 怪不得这么慢
3
92736 初项是2 2的fib嘛
#include <stdio.h>
#include <math.h>
void main(){
int a1 = 2, a2=2, limit = 24, temp;
// n1=2, n2=2, n3=n2+n1=4, n4=n3+n2=6, n5=n4+n3=10;
for(int i=3;i<=limit;i++){
temp = a2;
a2 = a1+a2;
a1 = temp;
}
printf("sum=%d",a2);
}
啊是‘对‘ 结果除以2就行了 46368
3
我爱你小甲鱼
0.100个
1.9个
2.c=5;b=c;a=b;
3.a=3
b=5
c=9
4.z=x?x>=0:z=-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)
{
stage2: printf("count = %d\n", count);
}
count++;
scanf("%d", &score);
1