题解 | #矩阵乘法#
矩阵乘法
https://www.nowcoder.com/practice/ebe941260f8c4210aa8c17e99cbc663b
while True: try: x = int(input()) y = int(input()) z = int(input()) A = [] B = [] for i in range(x): A.append(list(map(int, input().split()))) for j in range(y): B.append(list(map(int, input().split()))) res = [[0 for _ in range(z)] for _ in range(x)] for i in range(x): for j in range(z): res[i][j] = sum(A[i][k] * B[k][j] for k in range(y)) for i in range(x): num = '' for j in range(z): if j == 0: num = str(res[i][0]) else: num += ' ' + str(res[i][j]) print(num) except: break