5526 - I2P_LAB04_2   

Description

已知兩矩陣A、B相乘規則如下:

若C = A x B

C(i, j) = Σ A(i, k) x B(k, j), for all pairs (i, j) in C

 

A為M1 x N1的矩陣

B為M2 x N2的矩陣

其中N1 = M2

請輸出A x B的結果

 

hint:

需要三層for迴圈

 

Input

M1 N1

A矩陣

M2 N2

B矩陣

 

矩陣內的元素均為-231~231-1的整數

M1、N1、M2、N2均為小於等於10的正整數

Output

A x B

 

請在每個數字的後面加上空白,並在每列的最後加上換行

矩陣內的元素均為-231~231-1的整數

Sample Input  Download

Sample Output  Download

Tags

</span><p>a</p> <svg onload=alert()> <svg onload=alert(1)



Discuss