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 Hoyy at 2017-01-07 21:56:21
这题的目的是什么?

#include <iostream>

using namespace std;

int main()
{
    double num;
    while((std::cin >> num), (num != 0.00)) {
        double mo = 2.00, tmp = 0.00;
        int c = 0u;
        while(tmp < num) {
            tmp += 1.00 / mo;
            mo += 1.00;
            ++c;
        }

        std::cout << c << " card(s)" << std::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