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

我做的C

Posted by shutle at 2004-09-08 15:19:39 on Problem 1003
void main()
{
	float a,result=0;
	int n = 2;
	scanf("%f",&a);
	while(a!=0)
	{
		for (n=2,result=0; result<a; n++)
		{
			result += (float)1 / n;
		}	
		printf("%d card(s)\n",n-2);
		scanf("%f",&a);
	}
}

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