Note
- 进制转换
- 注意边界
Code:
#include<bits/stdc++.h>
using namespace std;
int main(){
#ifndef ONLINE_JUDGE
freopen("data.txt","r",stdin);
#endif
int c;
int j,wei[10];
char ra[3]={'A','B','C'};
cout<<"#";
for(int i=0;i<3;i++){
cin>>c;
j=0;
if(c==0) wei[j++]=0;
while(c>0){
wei[j]=c%13;
c/=13;
j++;
}
if(j==1) cout<<"0";
for(int i=j-1;i>=0;i--){
if(wei[i]<10) cout<<wei[i];
else cout<<ra[wei[i]-10];
}
}
return 0;
}