Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
389 邓小龙 14能吸多少根烟 C++ Accepted 0 MS 264 KB 279 2022-08-13 15:53:05

Tests(10/10):


Code:

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