#include <iostream>
#include <string>
using namespace std;
const char ch[]={'0','1','2','3','4','5','6','7','8','9','A','B','C'};
string DecTo13(int num){
string str;
char temp[3];
if(num==0){
temp[0]='0';
temp[1]='0';
}
else if(num<13){
temp[0]='0';
temp[1]=ch[num];
}
else{
temp[0]=ch[num/13];
temp[1]=ch[num%13];
}
temp[2]='\0';
str=temp;
return str;
}
int main(){
int r,g,b;
cin>>r>>g>>b;
cout<<'#'<<DecTo13(r)<<DecTo13(g)<<DecTo13(b);
return 0;
}
1027. Colors in Mars (20)
最新推荐文章于 2018-07-11 10:47:49 发布