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 calarence at 2014-11-02 21:21:37 on Problem 1003
#include <stdio.h>

int main(int agrc, char *argv[])
{
	float c, s;
	int i;

	while (scanf("%f", &c) == 1)
	{
		if (c == 0.00)
		{
			break;	
		}
		
		s = 0;
		i = 0;
		while (s < c)	
		{
			++i;
			s = s + 1.0/(i+1);	
		}

		printf("%d card(s)\n", i);
	}
	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