Skip to main content
1 of 3
Wug
  • 1.7k
  • 12
  • 12

#C, 48 chars

i(n,b){n?i(n/b,b),putchar(n%b+48+(n%b>9)*39):0;}
  • input of 0 produces empty string

#C, 77 chars, prints 0 for zero

j(n,b){n?j(n/b,b),putchar(n%b+48+(n%b>9)*39):0;}I(n,b){n?j(n,b):putchar(48);}

To run, call i for first version, I for second.

Wug
  • 1.7k
  • 12
  • 12