Run ID:76559

提交时间:2024-06-02 15:17:26

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