# 3095. 矩阵乘法

//********** Specification of multiply **********
void multiply(int (*A)[N], int (*B)[N], int (*C)[N],int n);
/* PreCondition:
A, B, and C are addresses of three matrices
and n (n<=N) is a positive integer
PostCondition:
C is the product of A and B.
*/


/***************************************************************/
/*                                                             */
/*  DON'T MODIFY main function ANYWAY!                         */
/*                                                             */
/***************************************************************/
#include <stdio.h>
#define N 10

//********** Specification of multiply **********
void multiply(int (*A)[N], int (*B)[N], int (*C)[N],int n)
/* PreCondition:
A, B, and C are addresses of three matrices
and n (n<=N) is a positive integer
PostCondition:
C is the product of A and B.
*/
{
}
/***************************************************************/

int main()
{
int A[N][N], B[N][N], C[N][N], n, i, j;
scanf("%d",&n);
for (i=0;i<n;i++)
for (j=0;j<n;j++)
scanf("%d",&A[i][j]);
for (i=0;i<n;i++)
for (j=0;j<n;j++)
scanf("%d",&B[i][j]);
/********** multiply is called here **************/
multiply(A,B,C,n);
/**************************************************/
for (i=0;i<n;i++)
for (j=0;j<n;j++)
printf("%d%c",C[i][j],j<n-1?' ':'\n');
return 0;
}


### 样例

Input
3
1 2 3
4 5 6
7 8 9
-1 8 9
10 -20 -30
34 56 -25

Output
121 136 -126
250 268 -264
379 400 -402


### 提示

$C_{ij} = \sum_{k=0}^{n-1}A_{ik} \times B_{kj}$

1017 人解决，1059 人已尝试。

1269 份提交通过，共有 2543 份提交。

0.3 EMB 奖励。