m = int(input())
matrix = [[int(_) for _ in input().split()] for __ in range(m)]
matrix = [[1 if i + j + 1 >= m else matrix[i][j] for j in range(m)] for i in range(m)]
[print(*_) for _ in matrix]
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
m = int(input())
matrix = [[int(_) for _ in input().split()] for __ in range(m)]
matrix = [[1 if i + j + 1 >= m else matrix[i][j] for j in range(m)] for i in range(m)]
[print(*_) for _ in matrix]