解题思路:
注意事项:
参考代码:
n = int(input()) num_start = [list(map(str, input().split())) for _ in range(n)] num_end = [list(map(str, input().split())) for _ in range(n)] def shun_90(arr): num1 = [list(col) for col in zip(*arr)] for i in range(len(num1)): num1[i].reverse() return num1 def ni_90(arr): num = [list(row) for row in arr] # 创建副本,以防在运行函数后将传递的参数改变 for i in range(len(num)): num[i].reverse() col = [list(col) for col in zip(*num)] return col def duichen(arr): num = [list(row) for row in arr] # 创建副本 n, m = 0, len(num) - 1 for i in range(len(num)): num[i].reverse() while n < int(len(num) / 2): num[n], num[m] = num[m], num[n] n += 1 m -= 1 return num def bubbian(arr): num = [list(row) for row in arr] # 创建副本 return num def compare_arr(arr1,arr2): if len(arr1) != len(arr2): return False for row1, row2 in zip(arr1, arr2): if row1 != row2: return False return True a = shun_90(num_start[:]) #创建副本,避免修改num_start的值 b = ni_90(num_start[:]) c = duichen(num_start[:]) d = bubbian(num_start[:]) if compare_arr(a,num_end): print(1) elif compare_arr(b,num_end): # 修改此处 print(2) elif compare_arr(c,num_end): print(3) elif compare_arr(d,num_end): print(4) else: print(5)
0.0分
0 人评分
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:943 |
母牛的故事 (C语言代码)浏览:739 |
C语言程序设计教程(第三版)课后习题9.4 (C语言代码)浏览:724 |
青年歌手大奖赛_评委会打分 (C语言代码)浏览:2248 |
printf基础练习 (C语言代码)浏览:2268 |
统计立方数 (C语言代码)浏览:890 |
母牛的故事 (java语言代码)浏览:896 |
小九九 (C语言代码)浏览:542 |
【亲和数】 (C语言代码)浏览:732 |
A+B for Input-Output Practice (II) (C++代码)浏览:656 |