generate functionFri, 10 Feb 2023

The input is a natural number n — the number of rows and columns in the matrix, the number of matrix elements (integers) line by line separated by a space. draw the maximum element below the main diagonal. The elements of the main diagonal are also taken into account.

def func(): n = int(input()) m = [] for i in range(n): m.append([int(j) for j in input().split()]) max_num = -float('inf') for i in range(n): for j in range(n): if i > j and m[i][j] > max_num: max_num = m[i][j] print(max_num)

Questions about programming?Chat with your personal AI assistant