boris-vlasenko

перевод из десятичной

Nov 26th, 2015
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. n = int(input())
  2. p = int(input())
  3. res = ''
  4. while n >= p:
  5.     res = str(n % p) + res
  6.     n = n // p
  7. res = str(n) + res
  8. print(res)
Advertisement
Add Comment
Please, Sign In to add comment