胖叽猪羊君 @ 2017-08-25 13:33:00
#include<iostream>
using namespace std;
int main(){
int n,k,yanshu,wh;
cin>>n>>k;
yanshu=n;
do{
wh=n/k;
yanshu+=wh;
n=n%k;
wh+=n;
}while(wh!=0);
return 0;
}
by wisdom_grass @ 2017-08-25 13:44:08
你一句cout都没有好吗
by 哀伤寒霜 @ 2017-08-25 13:51:46
不打输出怎么有输出。。。
by 胖叽猪羊君 @ 2017-08-25 13:53:19
还是没有
#include<iostream>
using namespace std;
int main(){
int n,k,yanshu,wh;
cin>>n>>k;
yanshu=n;
do{
wh=n/k;
yanshu+=wh;
n=n%k;
wh+=n;
}while(wh!=0);
cout<<yanshu;
return 0;
}
by 胖叽猪羊君 @ 2017-08-25 14:18:25
好了,谢谢大家