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

为什么测试都过了,还是wrong answer呢,求解,感激不尽

Posted by lpp001 at 2012-03-09 21:11:28 on Problem 1003
为什么测试都过了,还是wrong answer呢,求解,感激不尽
#include<iostream>
using namespace std;

int main()
{
	double s=0,c;
	int i=0;
	while (	cin>>c)
	{
		s=0;
		if(c>5.20||c<0.00 )
		continue;
		if(c==0.00)
		break;
		if(c<=0.50)
		{
			s=1;
			cout<<s<<"cards";
			continue;
		}
		for( i=2;s<c;i++)
		{
			s+=1.0/i;
		}
			cout<<i-2<<"cards";
	
	}

}

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