← Back to List

11294번: Numbers ↗

Solutions

Python 3
353 B | 353 chars
k = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
while True:
    a = input()
    if a == '#':
        break
    b = int(input())
    c = int(input())
    print("{}, {}, ".format(a,c),end="")
    s = ""
    if c == 0:
        print(0)
        continue
    while c>0:
        s += k[c%b]
        c//=b
    s=list(s)
    s.reverse()
    s="".join(s)
    print(s)