题解 | #矩阵乘法#

矩阵乘法

https://www.nowcoder.com/practice/ebe941260f8c4210aa8c17e99cbc663b

= int(input())

= int(input())

= int(input())

A,= [],[]

for i in range(x):

    A.append(list(map(int,input().split())))

for i in range(y):

    B.append(list(map(int,input().split())))

= []

for i in range(x):

    l = []

    for j in range(z):

        c = 0

        for k in range(y):

            c += A[i][k]*B[k][j]

        l.append(c)

    C.append(l)

for i in C:

    print(*i)

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务