题解 | #矩阵乘法#

矩阵乘法

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)

全部评论

相关推荐

真的很糟糕:欲哭无泪
点赞 评论 收藏
分享
06-20 17:42
东华大学 Java
凉风落木楚山秋:要是在2015,你这简历还可以月入十万,可惜现在是2025,已经跟不上版本了
我的简历长这样
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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