Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
74851 | 张皓睿 | 14能吸多少根烟 | C++ | Accepted | 0 MS | 272 KB | 258 | 2024-05-26 09:43:00 |
#include<iostream> #include<string> #include<cmath> #include<iomanip> using namespace std; int main(){ int c,s=0,ba,b = 0,n=0,k; cin>>c>>k; s += c; ba=c; while(ba >= k){ n = ba/k; b = ba%k; ba = n + b; s += n; } cout<<s; }