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

请帮忙看看吧。老是WA

Posted by wxh_8989 at 2009-05-27 13:30:41 on Problem 1003
#include<iostream>
using namespace std;
int main()
{
	float a,s;
	int n,i;
	cin>>a;
	while((int(a*100)!=0))
	{
		n=0;
		s=0;
		while(int(s*100)<int(a*100))
		{
			n++;
			s=s+1.0/(n+1);
		}
		cout<<n<<" card(s)"<<endl;
		cin>>a;	
	}
	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