using System;
namespace add_matrices
{
class Program
{
static void Main(string[] args)
{
int[,] array2D_A = new int[,]
{
{1, 2, 3}, {4 ,5, 6}, {7 ,8, 9},
};
for (int x = 0; x < 3; x++)
{
Console.WriteLine("{0} {1} {2}", array2D_A[x, 0], array2D_A[x, 1], array2D_A[x, 2] );
}
Console.WriteLine("");
int[,] array2D_B = new int[,]
{
{9, 8, 7}, {6, 5, 4}, {3, 2, 1},
};
for (int x = 0; x < 3; x++)
{
Console.WriteLine("{0} {1} {2}", array2D_B[x, 0], array2D_B[x, 1], array2D_B[x, 2] );
}
Console.WriteLine("");
int[,] Results = new int[3,3];
for (int x = 0; x < 3; x++)
{
for (int y = 0; y < 3; y++)
{
Results[x, y] = array2D_A[x, y] + array2D_B[x, y];
}
}
for (int x = 0; x < 3; x++)
{
Console.WriteLine("{0} {1} {2}", Results[x, 0], Results[x, 1], Results[x, 2] );
}
}
}
}