#include <stdio.h>
void cal_array(const int (*x)[3],const int (*y)[2],const int (*z)[2],int (*ans)[2]);

int main(void)
{
	int x[2][3]={{1,2,3},{4,5,6}};
	int y[3][2]={{6,5},{4,3},{2,1}};
	int z[2][2]={{10,6},{4,9}};
	int ans[2][2]={0};
	cal_array (x,y,z,ans);
	printf("計算結果 ans:\n");
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) {
            printf("%d ", ans[i][j]);
        }
        printf("\n");
    }
	return 0;
}

void cal_array(const int (*x)[3],const int (*y)[2],const int (*z)[2],int (*ans)[2])
{
	int cross[2][2]={0};
	for(int i=0;i<2;i++)
	{
		for(int j=0;j<2;j++)
		{
            for (int k=0;k<3;k++)
            {
                cross[i][j]+=x[i][k]*y[k][j];
            }
            ans[i][j]=cross[i][j]+z[i][j];
		}
	}
}
