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 max_below_main_diagonal(n): max = -100 for k in range(1,n): for i in range(0,n): for j in range(0,n): if (i+j) == k: if A[i][j] > max: max = A[i][j] print(max) max_below_main_diagonal(2)

Questions about programming?Chat with your personal AI assistant