Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Homework3_1
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int sum = 0;
- int productNumbers = 1;
- int line = 1;
- int column = 0;
- int[,] numbers = new int[2, 3]
- {
- { 7, 9, 2 },
- { 8, 4, 6 },
- };
- 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 i = 0; i < numbers.GetLength(1); i++)
- {
- sum += numbers[line, i];
- }
- for (int j = 0; j < numbers.GetLength(0); j++)
- {
- productNumbers *= numbers[j, column];
- }
- Console.WriteLine("Сумма " + (line + 1) + " строки: " + sum);
- Console.WriteLine("Произведение " + (column + 1) + " столбца: " + productNumbers);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement