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 |
Re:好阴险的水题啊,用__int64加scanf("%I64d %I64d",&n,&k)!=EOFIn Reply To:好阴险的水题啊,用__int64加scanf("%I64d %I64d",&n,&k)!=EOF Posted by:Ontheline at 2009-01-13 16:47:44 我也是int过的 #include<iostream> using namespace std; int main() { int n,k,sum,t; while(cin>>n>>k) { sum=n; t=n; while(t>=k) { sum+=t/k; t=t/k+t%k; } cout<<sum<<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