n = int(input("输入矩阵数:")) # matrix = [[2, 3, 4], # [5, 6, 7], # [8, 9, 1]] matrix = [] for i in range(n): lt = list(map(int, input("第" + str(i + 1) + "行矩阵:").split(" "))) matrix.append(lt) matr = rotatin(n, matrix) for i in range(n)...
从上图中,我们可以简单地将矩阵旋转 180 度,然后我们将不得不以相反的方式打印给定的矩阵。 Python3 # Python3 program to # rotate a matrix by # 180 degrees N = 3; # Function to Rotate # the matrix by 180 degree def rotateMatrix(mat): ...