矩阵乘法
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1010;
int n, m;
int x, y;
int res[N][N];
int a[N][N], b[N][N];
int main()
{
cin >> n >> m;
for (int i = 1; i <= n; i ++ )
for (int j = 1; j <= m; j ++ )
cin >> a[i][j];
cin >> x >> y;
for (int i = 1; i <= x; i ++ )
for (int j = 1; j <= y; j ++ )
cin >> b[i][j];
for (int i = 1; i <= n; i ++ )
for (int j = 1; j <= y; j ++ )
for (int k = 1; k <= m; k ++ )
res[i][j] += a[i][k] * b[k][j];
for (int i = 1; i <= n; i ++ )
{
for (int j = 1; j <= y; j ++ )
cout << res[i][j] << ' ';
puts("");
}
return 0;
}