提交时间:2023-12-30 10:29:11

运行 ID: 118376

#include<bits/stdc++.h> using namespace std; stack<char>q; char num[11097]={ }; const string ch="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; void asd(int x,int d) { while(x/d!=0) { int sct=x%d; q.push(ch[sct]); x/=d; } if(x/d==0) { q.push(ch[x]); } } int main() { int x,d; cin>>x>>d; asd(x,d); while(!q.empty()) { cout<<q.top(); q.pop(); } return 0; }