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

0ms纪念一下。。。。。。

Posted by lushanG130202 at 2014-02-13 21:37:32 on Problem 2509
#include <iostream>

using namespace std;

int main()
{
    int n,k;
    while(cin>>n>>k)
    {
        int left=n;
        while(left/k!=0)
        {
            n=left/k+n;
            left=left%k+left/k;
        }
        cout<<n<<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