Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Ijunior
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int row = 4;
- int column = 4;
- int[,] numbers = new int[row, column];
- int multiplication = 1;
- int sum = 0;
- int columnForMultiplication = 0;
- int rowForSum = 1;
- Random random = new Random();
- int minRandomNumber = 1;
- int maxRandomNumber = 10;
- for (int i = 0; i < numbers.GetLength(0); i++)
- {
- for (int j = 0; j < numbers.GetLength(1); j++)
- {
- numbers[i, j] = random.Next(minRandomNumber, maxRandomNumber);
- Console.Write(numbers[i, j] + " ");
- }
- Console.WriteLine();
- }
- for (int i = 0; i < numbers.GetLength(0); i++)
- {
- multiplication *= numbers[i, columnForMultiplication];
- }
- for (int i = 0; i < numbers.GetLength(1); i++)
- {
- sum += numbers[rowForSum, i];
- }
- Console.WriteLine($"Сумма {rowForSum + 1} ряда: " + sum);
- Console.WriteLine($"Произведение {columnForMultiplication + 1} столбца: " + multiplication);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment