Advertisement
nq1s788

Untitled

Oct 14th, 2023
1,109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. x = int(input()) #число в десятичной системе
  2. print(bin(x)[2:]) #переводит в двоичную систему
  3. ostatki = '' #все остатки от деления
  4. while x > 0:
  5.     ostatki = str(x % 2) + ostatki
  6.     x //= 2 #x = x // 2
  7. print(ostatki)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement