fork(1) download
  1. #include <stdio.h>
  2. int tohex(int n)
  3. {
  4. if(n==0)
  5. return;
  6. else
  7. {
  8. tohex(n/16);
  9. printf("%d",n%16);
  10. }
  11. }
  12.  
  13. int main(void) {
  14. int x;
  15. scanf("%d",&x);
  16. tohex(x);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 5320KB
stdin
16
stdout
10