Advertisement
1nikitas

Untitled

Dec 16th, 2019
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. x = int(input())
  2. n = ''
  3. l = 0
  4. if x == 0:
  5.     print(0)
  6. else:
  7.     while x > 0:
  8.         y = str(x%2)
  9.         z = int(x%2)
  10.         n = y + n
  11.         x = int(x-z)
  12.         x = int(x/2)
  13.         l = 1
  14. if l == 1:
  15.     print(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement