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

一次就AC了,0ms,这题水的

Posted by TSERROF at 2012-07-11 18:03:36 on Problem 1003
#include <iostream>
using namespace std;
int Cards(int n,double length)
{
	double sum=1.0/(n+1);
	while(sum<length)sum+=(1.0/(++n+1));
	return n;
}
int main()
{
	double length=0;
	while(cin>>length)
	{
		if(length==0.00)break;
		cout<<Cards(1,length)<<" card(s)"<<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