题解 | #矩阵乘法#
矩阵乘法
http://www.nowcoder.com/practice/ebe941260f8c4210aa8c17e99cbc663b
暴力破解
while True:
try:
x = int(input())
y = int(input())
z = int(input())
result1 = []
result2 = []
res = []
for j in range(x):
result1.append(list(map(int, input().split(' '))))
for k in range(y):
result2.append(list(map(int, input().split(' '))))
for i in range(len(result1)):
for j in range(z):
a = 0
for k in range(y):
a += result1[i][k]*result2[k][j]
res.append(a)
for i in range(0, len(res)):
endl = "\n" if (i+1)%z == 0 else " "
print(res[i], end = endl)
except:
break