1027 Colors in Mars (20 分)
Ideas
Base conversion still makes full use of quotient and remainder to
construct a character array for one-to-one mapping
Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
char ch[13] = {
'0','1','2','3','4','5','6','7','8','9','A','B','C'};
printf("%c%c%c%c%c%c%c",'#',ch[a/13],ch[a%13],ch[b/13],ch[b%13],ch[c/13],ch[c%13]);
}