Run ID:70215

提交时间:2024-04-14 10:31:06

#include<bits/stdc++.h> using namespace std; int x,r; int a[35]; int cnt=0; int main(){ cin>>x>>r; while(x!=0){ a[ant++]=x%r; x/=r; } for(int i=cnt-1;i>=0;i--){ if(a[i]<10){ cout<<a[i]; } else if(a[i]==10){ cout<<"A"; } else if(a[i]==11){ cout<<"B"; } } return 0; }