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