#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
using namespace std;
const int maxn = 10;
struct Matrix {
int row, col;
int matrix[maxn][maxn];
Matrix() {};
Matrix(int r, int c) :row(r), col(c) {}
};
Matrix Add(Matrix x, Matrix y) {
Matrix answer = Matrix(x.row, x.col);
for (int i = 0; i < answer.row; i++) {
for (int j = 0; j < answer.col; j++) {
answer.matrix[i][j] = x.matrix[i][j] + y.matrix[i][j];
}
}
return answer;
}
Matrix multuply(Matrix x, Matrix y) {
Matrix answer = Matrix(x.row, y.col);
for (int i = 0; i < x.row; i++) {
for (int j = 0; j < y.col; j++) {
answer.matrix[i][j] = 0; //注:将答案矩阵全部初始化为0
for (int k = 0; k < x.col; k++) {
answer.matrix[i][j] += x.matrix[i][k] * y.matrix[k][j];
}
}
}
return answer;
}
void printmatrix(Matrix answer) {
for (int i = 0; i < answer.row; i++) {
for (int j = 0; j < answer.col; j++) {
printf("%d ", answer.matrix[i][j]);
}
printf("\n");
}
}
int main() {
Matrix x(2,3);
Matrix y(3,2);
for (int i = 0; i < x.row; i++) {
for (int j = 0; j < x.col; j++) {
scanf("%d", &x.matrix[i][j]);
}
}
for (int i = 0; i < y.row; i++) {
for (int j = 0; j < y.col; j++) {
scanf("%d", &y.matrix[i][j]);
}
}
Matrix answer = multuply(x, y);
printmatrix(answer);
return 0;
}