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

Re:在下草鸟一个啊 麻烦哪位前辈指点一下啊! 先谢谢了

Posted by kachedingzi at 2010-03-12 10:33:19 on Problem 1003
In Reply To:在下草鸟一个啊 麻烦哪位前辈指点一下啊! 先谢谢了 Posted by:348854308 at 2010-02-02 23:17:14
#include <iostream>
using namespace std;

int main()
{
    float f;
    while (cin>>f&&f!=0.00)
    {
        int count = 0;
        float fsum = 0.00f;
        while (fsum<f&&++count)
            fsum += 1.0/(count+1);
        cout<<count<<" card(s)"<<endl;
    }

    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