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

高手赐教

Posted by zzyyinuo at 2010-04-13 09:49:47 on Problem 1003
#include <stdio.h>
void main()
{
	float a[5];
	int i,j;
	for(i=0;i<=4;i++)
		scanf("%f",&a[i]);
	for(j=0;j<=4;j++)
	{
		int n=0;                    
		float b=0.00;               
		for(;b<a[j];n++)  
        {
			if(a[j]==0)
				continue;
			else
				b+=1/(n+2);
		}
		printf("%d card(s)\n",n);
	}
}


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