Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
76567 Kevin 14能吸多少根烟 C++ Wrong Answer 1 MS 272 KB 217 2024-06-02 15:19:01

Tests(0/10):


Code:

#include<iostream> #include<cmath> using namespace std; int main(){ int n,k,s=0,yu=0; cin>>n>>k; s=n; while(1){ yu=n%k; n=n+yu; n=n/k; s+=n; if(n==0) break; } cout<<s; return 0; }


Run Info:

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