fork download
  1. a,m = map(int, input().split())
  2. b = []
  3. counter = 0
  4. while a != 0:
  5. b.append(a % m)
  6. a = int(a/m)
  7. counter += 1
  8. ([print(b[i - 1], end="") for i in range(counter, 0, -1)])
Success #stdin #stdout 0.02s 9232KB
stdin
10 9
stdout
11