杭电2047我哪里错了啊#includemain(){double fib,fib1,fib2,n,i;while (scanf("%lf",&n)!=-1){fib1=3 ;fib2=8;if(n==1) printf("%.0lf\n",fib1);else if(n==2)printf("%.0lf\n",fib2);else{for (i=3;i

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/24 22:42:18
杭电2047我哪里错了啊#includemain(){doublefib,fib1,fib2,n,i;while(scanf("%lf",&n)!=-1){fib1=3;fib2=8;if(n==1)

杭电2047我哪里错了啊#includemain(){double fib,fib1,fib2,n,i;while (scanf("%lf",&n)!=-1){fib1=3 ;fib2=8;if(n==1) printf("%.0lf\n",fib1);else if(n==2)printf("%.0lf\n",fib2);else{for (i=3;i
杭电2047我哪里错了啊
#include
main()
{double fib,fib1,fib2,n,i;
while (scanf("%lf",&n)!=-1)
{
fib1=3 ;fib2=8;
if(n==1) printf("%.0lf\n",fib1);
else if(n==2)printf("%.0lf\n",fib2);
else
{for (i=3;i

杭电2047我哪里错了啊#includemain(){double fib,fib1,fib2,n,i;while (scanf("%lf",&n)!=-1){fib1=3 ;fib2=8;if(n==1) printf("%.0lf\n",fib1);else if(n==2)printf("%.0lf\n",fib2);else{for (i=3;i
while (scanf("%lf",&n)!=-1) 改成
while (scanf("%lf",&n)!=0)
scanf()返回值是读入数据的个数!