n = int(input())
m = int(input())
matrix = [[int(input()) for i in range(n)] for z in range(m)]
maximum = matrix[0][0]
id = 0
for i in range(n):
if max(matrix[i]) > maximum:
maximum = max(matrix[i])
id = i
matrix += [matrix[id]]
print(matrix)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
n = int(input())
m = int(input())
matrix = [[int(input()) for i in range(n)] for z in range(m)]
maximum = matrix[0][0]
id = 0
for i in range(n):
if max(matrix[i]) > maximum:
maximum = max(matrix[i])
id = i
matrix += [matrix[id]]
print(matrix)