SHARE
TWEET

Untitled

a guest Oct 23rd, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def troic(a):
  2.     st = ''
  3.     while True:
  4.         b = a % 3
  5.         c = a // 3
  6.         if b == 2:
  7.             st += '#'
  8.             c += 1
  9.         else:
  10.             st += str(b)
  11.         if c == 0:
  12.             break
  13.         else:
  14.             a = c
  15.     return st[::-1]
  16.  
  17. f = int(input())
  18. print(troic(f))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top