Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CSLightFirst
- {
- class Program
- {
- static void Main()
- {
- Random rand = new Random();
- int[,] data = new int[5, 5];
- int sumSecondRow = 0;
- int compositionFirstCol = 1;
- for (int i = 0; i < data.GetLength(0); i++)
- {
- for (int j = 0; j < data.GetLength(1); j++)
- {
- data[i, j] = rand.Next(0, 9);
- Console.Write(data[i, j] + " ");
- }
- Console.WriteLine();
- }
- for (int i = 0; i < data.GetLength(1); i++)
- sumSecondRow += data[1, i];
- for (int i = 0; i < data.GetLength(0); i++)
- compositionFirstCol *= data[i, 0];
- Console.WriteLine($"\nСумма второй строки массива равна {sumSecondRow}\n" +
- $"Произведение первого столбца массива равно {compositionFirstCol}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement