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:帮我看看!输出的结果正确,可怎么是wrong answer?

Posted by 210727199304015729 at 2011-07-10 16:08:53 on Problem 2509
In Reply To:帮我看看!输出的结果正确,可怎么是wrong answer? Posted by:Oldmaner at 2007-01-23 14:00:58
> #include<iostream>
> using namespace std;
> int main()
> { int n,k,t,s=0;
> cin>>n>>k;
> t=n;
> for(int i=1; ;i++)
> {
> if(n<k) break;
> else
>  {s=s+n/k;
>  n=n/k+n%k;}
> }
> cout<<s+t<<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