Ответ: python
import random
m = [0]*20
for i in range(len(m)):
m[i] = random.randint(-11, 15)
sum = 0
for j in range(len(m)):
if m[j] > 0:
sum += m[j]
m[0] = sum
m[-1] = sum
print(m)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ: python
import random
m = [0]*20
for i in range(len(m)):
m[i] = random.randint(-11, 15)
sum = 0
for j in range(len(m)):
if m[j] > 0:
sum += m[j]
m[0] = sum
m[-1] = sum
print(m)