Run ID:162462
提交时间:2026-10-17 15:26:10
#include<bits/stdc++.h> using namespace std; int a[100]; int main(){ long long x,i = 0,r; cin >> x >> r; if(x == 0){ cout << 0; return 0; } while(x > 0){ a[i] = x % r; x = x / r; i++; } while(i--){ if(a[i] > 9){ cout << char(a[i] + 'A' - 10); }else{ cout <<a[i]; } } return 0; }