| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
怎么会wa?郁闷~大虾们帮我找找错误吧~#include<stdio.h>
void main()
{
int i,sum;
double a,b,c[480];
c[0]=1;c[1]=2;
for(i=2;i<480;i++)
c[i]=c[i-1]+c[i-2];
while(1)
{
scanf("%lf%lf",&a,&b);
if(b==0) break;
else
{
sum=0;
for(i=0;i<480;i++)
if(c[i]>=a&&c[i]<=b) sum++;
else if(c[i]>b) break;
printf("%d\n",sum);
}
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator