Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- internal class Program
- {
- static void Main(string[] args)
- {
- int[,] array = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
- int sum = 0;
- int product = 1;
- int line = 1;
- int column = 0;
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- Console.Write(array[i, j] + " ");
- }
- Console.WriteLine();
- }
- for (int i = 0; i < array.GetLength(0); i++)
- {
- product = product * array[i, column];
- }
- for (int i = 0; i < array.GetLength(1); i++)
- {
- sum += array[line, i];
- }
- Console.WriteLine($"\nCумму {line + 1}-ой строки: " + sum); ;
- Console.WriteLine($"\nПроизведение {column + 1}-го столбца: " + product);
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement