#include <iostream.h>
int M1[10][10], M2[10][10], M3[10][10];
int x1, x2, y1, y2; // The Arrays Length
void main()
{
cin >> x1 >> y1 >> x2 >> y2;
//input array1
for (int i=0; i < x1; i++)
for (int j=0; j < y1; j++)
cin >> M1[j];
//input array2
for (i =0 ; i < x2; i++)
for (int j=0; j < y2; j++)
cin >> M2[j];
cout << endl;
//Multiply Arrays
for (i = 0 ; i < x1; i++)
for (int k=0; k < y2; k++)
for (int j=0; j < y1; j++)
M3[k] += M1[j] * M2[j][k];
cout << endl;
//print the new array
for (i = 0; i < x1; i++)
{
for (int j = 0; j < y2; j++)
cout << M3[j] << "\t";
cout << endl;
}
}
//Multiply Arrays
void Multiply(int x1, int y2, int y1)
{
for (int i = 0 ; i < x1; i++)
for (int k=0; k < y2; k++)
for (int j=0; j < y1; j++)
M3[k] += M1[j] * M2[j][k];
}
//Bubble Sort
void Sort(int Matrix[], int Length)
{
int temp;
for (int i=1; i < Length - 1; i++)
for (int j=0; j < Length - i; j++)
if (Matrix[j] > Matrix[j+1])
{
int temp = Matrix[j];
Matrix[j] = Matrix[j+1];
Matrix[j+1] = temp;
}
}
