Run ID:75463

提交时间:2024-05-26 18:16:58

#include<bits/stdc++.h> using namespace std; int main(){ double n; cin >> n; int z = n; double x = n - z; int r; cin >> r; int b[32],cnt = 0; while(z != 0){ int yu = z%r; b[cnt] = yu; cnt++; z/=r; } if(cnt == 0){ cout << "0"; }else{ for(int i = cnt-1;i >=0;i--){ if(b[i]<10){ cout <<b[i]; }else{ b[i] += 55; cout << (char)b[i]; } } } return 0; }