nq1s788

перевод из 10й в произвольную

Nov 12th, 2025
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. n = int(input())
  2. x = int(input())
  3. s = ''
  4. alph = 'ABCDEFGHIKL'
  5. while n != 0:
  6.     if n % x < 10:
  7.         s = str(n % x) + s
  8.     else:
  9.         s = alph[n % x - 10] + s
  10.     n = n // x
  11. print(s)
Advertisement
Add Comment
Please, Sign In to add comment