Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
59195 谢绍澜 14能吸多少根烟 C++ Accepted 3 MS 272 KB 216 2023-10-19 18:30:11

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int n,k,m=0,sum=0; cin>>n>>k; while(n!=0){ sum+=n; m+=n; n=m/k; m=m%k; } cout<<sum; return 0; }