Run ID:162612
提交时间:2026-10-17 18:01:21
#include<bits/stdc++.h> using namespace std; int main(){ int n,r; cin>>n>>r; stack<int>s; if(n==0){ cout<<0; return 0; } while(n>0){ s.push(n%r); n=n/r; } while(!s.empty()){ int k=s.top(); s.pop(); if(k>9){ cout<<char(k+55); }else{ cout<<k; } } return 0; }