提交时间:2024-04-06 09:25:58

运行 ID: 141647

#include<bits/stdc++.h> using namespace std; #define I am jvruo stack<char>stk; char a[37]={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; int main() { int n,d; cin>>n>>d; while(n) { stk.push(a[n%d]); n/=d; } if(stk.empty()) cout<<0<<endl; while(!stk.empty()) { cout<<stk.top(),stk.pop(); } }