public static void Main()
int n = int.Parse(Console.ReadLine());
int m = int.Parse(Console.ReadLine());
int[,] array = new int[n, m];
for (int row = 0; row < array.GetLongLength(0); row++)
for (int col = 0; col < array.GetLength(1); col++)
array[row, col] = int.Parse(Console.ReadLine());
Console.WriteLine("The elements on array is:");
for (int row = 0; row < array.GetLength(0); row++)
for (int col = 0; col< array.GetLength(1); col++)
Console.WriteLine(array[row, col]);
for (int row = 0; row < array.GetLength(0); row++)
for (int col = 0; col < array.GetLength(1); col++)
int currentElement = array[row, col];
sum = sum + currentElement;
Console.WriteLine("The sum is: {0}", sum);