Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6146 吴承熹 14能吸多少根烟 C++ Accepted 0 MS 272 KB 223 2025-01-11 08:46:26

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int n,k=1,a=0,b=0; cin>>n>>k; while(n){ n--; a++; b++; if(b==k){b=0,n++;} } cout<<a<<endl; return 0; }