Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Study
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[3, 3];
- int sumOfTheSecondLine = 0, productOfTheFirstColumn = 1;
- Console.WriteLine("Исходная матрица");
- Random rand = new Random();
- for (int i = 0; i < 3; i++)
- {
- for (int j = 0; j < 3; j++)
- {
- array[i, j] = rand.Next(0, 50);
- Console.Write(array[i, j] + " ");
- }
- Console.WriteLine();
- }
- for ( int i = 0; i < 3; i++)
- {
- sumOfTheSecondLine += array[i, 1];
- }
- for (int j = 0; j < 3; j++)
- {
- productOfTheFirstColumn *= array[j, 0];
- }
- Console.WriteLine("Сумма второй строки");
- Console.Write(sumOfTheSecondLine);
- Console.WriteLine();
- Console.WriteLine("Произведение первого столбца");
- Console.Write(productOfTheFirstColumn);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement