Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num = int(input('输入一个整数:'))
- result = ''
- if num == 1:
- result = '1'
- while num > 0:
- result = str(num%2) + result
- num = num//2
- print(result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement