Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def troic(a):
- st = ''
- while True:
- b = a % 3
- c = a // 3
- if b == 2:
- st += '#'
- c += 1
- else:
- st += str(b)
- if c == 0:
- break
- else:
- a = c
- return st[::-1]
- f = int(input())
- print(troic(f))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement