Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
74814 李雨昊 14能吸多少根烟 C++ Wrong Answer 0 MS 268 KB 223 2024-05-26 09:07:13

Tests(0/10):


Code:

#include<iostream> #include<cstdio> using namespace std; int main() { int n,k,c=0,a=0; cin>>n>>k; a=n; while(1){ if(n>=k){ c=n%k+1; n=c; c+=n; } if(n<k){ break; } }cout<<c+a; }


Run Info:

------Input------
159 16
------Answer-----
169
------Your output-----
161