Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

谁能看看我的代码错哪了? 谢谢

Posted by liyonggang at 2010-05-15 09:53:43 on Problem 2413
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator