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 905982692 at 2011-07-27 09:05:03 on Problem 1003
In Reply To:庆祝,一次性AC,0MS,哈哈,贴下代码 Posted by:denganliang at 2011-03-13 16:42:33
#include<stdio.h>
int main()
{
	int i;
	double sum ,n;
	while(scanf("%lf",&n),n)
	{
	  sum=0;
	  for(i=1;i;i++)
	  {
		sum+=1.0/(i+1);			
	    if(sum-n>=0) {;break;}
	  }
	  printf("%d card(s)\n",i);
	}
}

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