Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
2509真郁闷,为什么老是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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator