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 348854308 at 2010-02-02 23:17:14 on Problem 1003
#include<iostream>
#include <cmath>
using namespace std;
int main()
{
    float a;
    while(cin>>a)
   {
           double sum=0;
           for(long i=2;i<=1000000;i++)
           {
                 sum=sum+(double)1/i;
                 if(a<=sum)
                 {
                        cout<<i-1<<" card(s)"<<endl;
                        break;
                 }
           }
              
   }
   system("pause");
   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