提交时间:2026-06-05 15:12:48

运行 ID: 90118

#imclude<bits/stdc++.h> using namespace std; char l(int n){ if(0<=n<=9) return '0'+n; else return 'A'+n-10; } void trans(int x,int m){ if(x<m) cout<<l(x); else{ trans(x/m,m); cout<<l(x%m); } } int main(){ int X,M; cin>>X>>M; trans(X,M); return 0; }