提交时间:2024-04-06 08:47:01
运行 ID: 141603
#include<bits/stdc++.h> using namespace std; char a[1000005]; int tot = 0; int main(){ int n,d; cin>>n>>d; string s = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; while(n){ a[++tot] = s[n%d]; n/=d; } for(int i=tot;i>=1;i--){ cout<<a[i]; } cout<<'\n'; return 0; }