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。

Posted by 2013wb at 2014-04-10 20:00:48 on Problem 1003
#include<stdio.h>
int main()
{
	int i;
	double n,sum;
	while(scanf("%lf",&n)!=EOF&&n)
	{
		sum=0.0;
		for(i=2;i<10000;i++) 
		{
			sum=sum+1.0/i;
			if(sum>n)
			break;
		}
		printf("%d card(s)\n",i-1);
	}
	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