public static void Main()
int[,] array = { { 5, 6, 6 }, { 4, 8, 2 }, { 5, 2, 6 } };
Console.Write("Ввод номера строки: ");
int n = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("\nПравильный вариант 1 (без цикла)");
Console.WriteLine("g = " + array[n, 0] + "+" + array[n, 1] +"+" + array[n, 2]);
g = array[n, 0] + array[n, 1] + array[n, 2];
Console.WriteLine("g="+g);
Console.WriteLine("\n\nПравильный вариант 2 (с циклом)");
Console.WriteLine("Начало цикла. sum=0");
Console.WriteLine("\na="+i+" sum="+sum);
Console.Write("sum = " + sum + " + " + array[n, i]);
Console.WriteLine("; sum = " + sum);
Console.WriteLine("\nКонец цикла");
Console.WriteLine("сумма " + n +" строки равна "+sum);