| ||||||||||
| 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:谁能帮忙看一下2509题怎么定义结束条件啊?In Reply To:谁能帮忙看一下2509题怎么定义结束条件啊? Posted by:15849119680 at 2009-08-22 10:50:48 while(cin>>n>>k)
{
sum=n;
while(n/k>=1)
{
sum=sum+n/k;
n=n/k+n%k;
}
cout<<sum<<endl;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator