困死惹 提个神
题目链接 advanced1027
#include
const char digit[13]={'0','1','2','3','4','5',
'6','7','8','9','A','B','C'};
void trans(int dec,char target[]){
target[0]=digit[dec/13];
target[1]=digit[dec%13];
}
int main() {
int rd,gd,bd;
char rr[3],gg[3],bb[3];
rr[2]='\0',gg[2]='\0',bb[2]='\0';
scanf("%d%d%d",&rd,&gd,&bd);
trans(rd,rr);
trans(gd,gg);
trans(bd,bb);
printf("#%s%s%s",rr,gg,bb);
return 0;
}