Cymbid @ 2019-11-16 15:51:29
代码:
#include<iostream>
using namespace std;
int n,k,kshu,ans=0;
//n:烟的数量 k:k个烟蒂可以换一个新的烟 kshu:烟蒂的数量 ans:答案
void chickenYouAreSoBeautiful(){
if(kshu<k)return;
else{
n=kshu/k;
kshu=kshu%k;
ans+=n;
chickenYouAreSoBeautiful();
}
return;
}
int main(){
cin>>n>>k;
ans=n;
kshu=n;
chickenYouAreSoBeautiful();
cout<<ans;
return 0;
}
by Phartial @ 2020-11-06 21:30:41
鸡你太美可还行