你谷的数据太强了,我居然没过(其他网站 AC 了)
#include<bits/stdc++.h>
using namespace std;
int main() {
long long n, m;
cin >> n >> m;
if (n == 0) {
cout << 0;
return 0;
}
string s = "";
while (n) {
if (n % m < 9) s = char(n % m + '0') + s;
else s = char(n % m - 10 + 'A') + s;
n /= m;
}
cout << s;
}