1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
constexpr int MAXROW{ 4 }, MAXCOL{ 4 };
int matrix1[MAXROW][MAXCOL]
{
{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12},
{13, 14, 15, 16}
};
int matrix2[MAXROW][MAXCOL]
{
{1, 4, 3, 2},
{8, 6, 7, 5},
{9, 12, 11, 10},
{13, 14, 16, 15}
};
int matrix3[MAXROW][MAXCOL]{};
matrix3[0][0] = matrix1[0][0] + matrix2[0][1];
// Or maybe it means:
matrix3[0][0] = matrix1[0][0] + matrix2[3][0];
// And the next would be:
matrix3[0][0] = matrix1[0][1] + matrix2[3][1];
|