#include<stdio.h>
int main()
{
	double Matrix1[10][10];
	double Matrix2[10][10];
	double Matrix3[10][10] = {0};
	int i, j, k, m, n, p;
	printf ("m = ");
	scanf("%d", &m);
	printf ("n = ");
	scanf("%d", &n);
	printf ("p = ");
	scanf("%d", &p);
	printf("aedad matrix %d * %d : \n", m, n);
	//nested loop avval
	//por kardane matrise avval
	for(i = 0; i < m; i++)
		for(j = 0; j < n; j++)
			scanf("%lf", &Matrix1[i][j]);
			
	printf("aedad matrix %d * %d : \n", n, p);
	//nested loop dovvom
	//por kardane matrise dovvom	
	for(i=0; i < n; i++)
		for(j=0; j < p; j++)
			scanf("%lf", &Matrix2[i][j]);
	//nested loop sevvom
	//amale zarbe matrise avval va dovvom va zakhire dar matrise sevvom
	for(i=0; i < m; i++)
		for(j=0; j < p; j++)
			for(k=0; k < n; k++)
				Matrix3[i][j] += Matrix1[i][k] * Matrix2[k][j];
	//loop chaharom
	for(i=0; i < m; i++)
	{
		for(j=0; j < p; j++)
			printf("%7.2f", Matrix3[j][i]);
		printf("\n");
	}
	getch();
}

