Run ID:48628
提交时间:2023-06-10 15:49:19
//include<bits/stdc++.h>erase #include<iostream> #include<string> int a[330]; using namespace std; int main(){ //freopen(a.in,"r",stdin); //freopen(b.out,"w",stdout); int n,r; string s = "ABCDEF"; cin >> n >> r; if(n == 0) { cout << "0"; } else{ int c = 0,t = n;; while(t != 0){ a[c] = t % r; t /= r; c++; } for(int i = c - 1;i >=0;i--){ if(a[i] >= 10){ cout << s[a[i] % 10]; } else{ cout << a[i]; } } } return 0; }