Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] numbers = { { 1, 3, 4, }, { 5, 4, 3, } };
- int sum = 0;
- int multiplication = 1;
- int numberСolumns = 2;
- int numberLines = 1;
- for (int i = 0; i < numbers.GetLength(0); i++)
- {
- for (int j = 0; j < numbers.GetLength(1); j++)
- {
- Console.Write(numbers[i, j] + " ");
- }
- Console.WriteLine();
- }
- for (int j = 0; j < numbers.GetLength(0); j++)
- multiplication *= numbers[j, numberLines - 1];
- for (int i = 0; i < numbers.GetLength(1); i++)
- sum += numbers[numberСolumns - 1, i];
- Console.WriteLine($"Сумма {numberСolumns} строки равна {sum}.");
- Console.WriteLine($"Произведение {numberLines} столбца {multiplication}.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement