Ответ: 64+32+16+8+1+1
вот такое вот решение на python
n = 122
s = ''
while n > 0:
counter = 0
for i in range(1, 10):
if 2**i < n:
counter += 1
else:
s = s + str(2**counter)
n = n - 2**counter
break
s = s + ' '
s = s[:-1]
s = s.replace(' ', '+')
print(s)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ: 64+32+16+8+1+1
вот такое вот решение на python
n = 122
s = ''
while n > 0:
counter = 0
for i in range(1, 10):
if 2**i < n:
counter += 1
else:
s = s + str(2**counter)
n = n - 2**counter
break
s = s + ' '
s = s[:-1]
s = s.replace(' ', '+')
print(s)