方法1:
int n = value % 16;
if(n < 10)
putchar(n + '0');
else
putchar(n - 10 + 'A');
方法2:
putchar("0123456789ABCDEF"[value %1 6]);