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 |
谁能看看我的代码错哪了? 谢谢#include<iostream> using namespace std; int main() { double a1,b; double a[150]; a[0]=1;a[1]=2; for(int i=2;i<150;i++) a[i]=a[i-1]+a[i-2]; while(true) { cin>>a1>>b; if(a1==0&&b==0) break; int sum=0; for(int i=0;i<150;i++) { if(a1<=a[i]&&a[i]<=b) sum++; } cout<<sum<<endl; } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator