Ответ:
from random import randint
n = int(input('size: '))
m = [[randint(0, 100) for _ in range(n)] for _ in range(n)]
print('матрица:')
c = []
for r in range(n):
print(*m[r])
c.append(m[r][0])
print('макс-элемент:', max(map(max, m)))
rows = [sum(row) for row in m]
print('сумма элемнтов:', sum(rows))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
from random import randint
n = int(input('size: '))
m = [[randint(0, 100) for _ in range(n)] for _ in range(n)]
print('матрица:')
c = []
for r in range(n):
print(*m[r])
c.append(m[r][0])
print('макс-элемент:', max(map(max, m)))
rows = [sum(row) for row in m]
print('сумма элемнтов:', sum(rows))