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:2509

Posted by SuperYanyan at 2010-02-23 23:22:38 on Problem 2509
In Reply To:2509 Posted by:liyonggang at 2009-09-02 16:32:36
> 真郁闷,为什么老是WA  明明正确的呀
> #include<iostream>
> using namespace std;
> int main()
> {
> 	int a,b;
> 	while(cin>>a>>b)
> 		{
> 			long sum=0;int m=0;
> 			if(b<=1) break;
> 			m=a;
> 			while(a>=b) 
> 			{
> 				a=a/b;
> 		        sum+=a;
> 			}
> 			cout<<sum+m<<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