📌  相关文章
📜  在python代码示例中顺时针旋转矩阵90度

📅  最后修改于: 2022-03-11 14:45:38.718000             🧑  作者: Mango

代码示例1
#The program defines the square matrix 90 degrees clockwise direction.
m,n  = map(int,input().split())
#m,n are the number of rows and columns.
#m = int(input('rows'))
l = []
for i in range(m):
    x = list(map(int,input().split()))  #for taking the  rows a time and split it append to an empty list        
    l.append()
for i in range(m):
    for j in range(m-1,-1,-1):
        print(l[j][i],end=' ')
    print(end='\n')