Advertisement
pol9na

Untitled

Mar 9th, 2020
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Study
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[,] array = new int[3, 3];
  14.  
  15.             Console.WriteLine("Исходная матрица");
  16.             Random rand = new Random();
  17.             for (int i = 0; i < 3; i++)
  18.             {
  19.                 for (int j = 0; j <3; j++)
  20.                 {
  21.                     array[i, j] = rand.Next(0, 50);
  22.                     Console.Write(array[i, j] + " ");
  23.                 }
  24.                 Console.WriteLine();
  25.             }
  26.             for (int i = 0; i < 3; i++)
  27.             {
  28.                 for (int j = 0; j < 3; j++)
  29.                 {
  30.                     int SumOfTheSecondLine = 0, ProductOfTheFirstColumn = 1;
  31.                     for (i = 0; i < 3; i++)
  32.                         SumOfTheSecondLine += array[1, i];
  33.                     {
  34.                         for (j = 0; j < 3; j++)
  35.                         {
  36.                             ProductOfTheFirstColumn *= array[j, 0];
  37.                         }
  38.                     }
  39.                     Console.WriteLine("Сумма второй строки");
  40.                     Console.Write(SumOfTheSecondLine);
  41.                     Console.WriteLine();
  42.                     Console.WriteLine("Произведение первого столбца");
  43.                     Console.Write(ProductOfTheFirstColumn);
  44.                 }
  45.                 Console.ReadKey();
  46.             }
  47.  
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement