题解 | #求最小公倍数#
矩阵乘法
http://www.nowcoder.com/practice/ebe941260f8c4210aa8c17e99cbc663b
x = int(input())
y = int(input())
z = int(input())
lst_1 = []
lst_2 = []
for i in range(x):
l1 = list(map(int, input().split()))
lst_1.append(l1)
for i in range(y):
l2 = list(map(int, input().split()))
lst_2.append(l2)
lst_2_new = []
for i in range(z):
l = []
for j in range(y):
l.append(lst_2[j][i])
lst_2_new.append(l)
res = []
for i in lst_1:
la = []
for j in lst_2_new:
ls = list(map(lambda x,y:x*y, i,j))
s = sum(ls)
la.append(s)
res.append(la)
for line in res:
line = [str(x) for x in line]
print(' '.join(line))

查看11道真题和解析