using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите колво строк");
int n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите колво столбцов");
int m = Convert.ToInt32(Console.ReadLine());
int s = 0;
int[,] a = new int[n, m];
Console.WriteLine("Введите элем массива");
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
a[i, j] = int.Parse(Console.ReadLine());
}
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
Console.Write(a[i, j] + " ");
}
Console.WriteLine();
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
s += a[i, j];
}
}
Console.WriteLine(s);
}
}