Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #если основание до 10
- n = int(input())
- x = ''
- while n != 0:
- x = str(n % 3) + x
- n //= 3
- print(x)
- #если больше 10
- n = int(input())
- x = ''
- while n != 0:
- if n % 13 > 10:
- x = 'ABC'[n % 13 - 10] + x
- else:
- x = str(n % 13) + x
- n //= 13
- print(x)
Advertisement
Add Comment
Please, Sign In to add comment