标签:clu bsp col ret stack std turn code top
#include <iostream> #include <stack> using namespace std; int main() { int r,n,ans=0; stack<int>s; cin>>n>>r; while(n) { s.push(n%r); n/=r; } while(!s.empty()) { ans+=s.top(); s.pop(); } cout<<ans<<endl; return 0; }
标签:clu bsp col ret stack std turn code top
原文地址:https://www.cnblogs.com/zhanghua-322/p/11302390.html