generate functionFri, 10 Feb 2023

The input is a natural number n — the number of rows and columns in the square matrix. Next, the elements of the matrix are entered line by line with a space. Output the maximum element excluding the area above the main diagonal.

def max(n): max = 0 for i in range(n): a = [int(i) for i in input().split()] for j in range(n): if a[j] > max and i < j: max = a[j] return max

Questions about programming?Chat with your personal AI assistant