Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #13 https://kompege.ru/variant?kim=25088424
- def to_bin(x):
- s = bin(x)[2:]
- return '0' * (8 - len(s)) + s
- setb = to_bin(172) + '.' + to_bin(16) + '.' + to_bin(80) + '.' + to_bin(0)
- maska = to_bin(255) + '.' + to_bin(255) + '.' + to_bin(248) + '.' + to_bin(0)
- print(setb)
- print(maska)
- cnt = 0
- for x in range(2**11):
- s = bin(x)[2:]
- if s.count('1') % 2 != 0:
- cnt += 1
- print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment