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

poj做的第二题吧,第一次丢了card还给wa了。。诸位知道5.20什么的有什么用么..?

Posted by hyace at 2012-06-09 11:08:44 on Problem 1003
//poj做的第二题吧,第一次丢了card还给wa了。。
//貌似根本不用考虑5.20什么的限制条件?
#include<stdio.h>
int main(){
    float a=0;
    while(scanf("%f",&a)!= EOF&&a!=0.00)  {
              int i=0;
	      float s=0; 
              while(s<a)
                  s=s+(float)1/(++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