#include <stdio.h>
char *tpl = "0123456789ABCDEF";
int main() { int num; char buffer[20]; char *pBuf; scanf("%d", &num); if (num == 0) puts("0"); else { buffer[19] = '\0'; for (pBuf = buffer + 18; num > 0; pBuf--) { *pBuf = tpl[num & 0x0f]; num >>= 4; } puts(pBuf + 1); } return 0; }
|