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 rainwhy at 2008-09-20 11:34:07 on Problem 1003
#include <stdio.h> 

int main () 
{ 
 int i; 
 int counter; 
 float sum; 
 float c; 
 scanf("%f", &c); 
 while(c != 0.00 && c >= 0.01 && c <= 5.20)
 { 
 counter = sum = 0; 
 for(i = 2; sum < c; i++) 
   { 
    sum += 1.00/i; 
    counter++; 
   } 
 printf("%d card(s)\n", counter); 
 scanf("%f", &c); 
 }
 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