#include<bits/stdc++.h> using namespace std; int main() { int a,b; string s; cin>>a>>b; while(a>0) { int o=a%b; if(o>=10){ s+='A'-10+o; }else{ s+='0'+o; } a/=b; } reverse(s.begin(),s.end()); cout<<s; return 0; }
CCF4302CCF4302CCF4302
#include<bits/stdc++.h> using namespace std; int main() { int N,R; cin>>N>>R; string ans; while(N>0){ int n=N%R; char c; if(n < 10) c=n +'0'; else c=n-10+'A'; ans+=c; N/=R; } reverse(ans.begin(), ans.end()); cout << ans; return 0; }
Using your lizikid universal account