행렬 곱셈
#pragma warning(disable:4996)
#include <stdio.h>
int main(void)
{
int arr1[2][2] = { 3,0,3,0 };
int arr2[2][2] = { { 2, 2 }, { 2, 2 } };
printf("%3d %3d\n",
arr1[0][0] * arr2[0][0] + arr1[0][1] * arr2[1][0],
arr1[0][0] * arr2[0][1] + arr1[0][1] * arr2[1][0]);
printf("%3d %3d\n",
arr1[1][0] * arr2[0][0] + arr1[1][1] * arr2[1][0],
arr1[1][0] * arr2[0][1] + arr1[1][0] * arr2[0][2]);
return 0;
}
0 개의 댓글: