Advertisement
pol9na

Untitled

Mar 7th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 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 = { { 0, 1, 2, }, { 3, 4, 5 }, { 6, 7, 8 } };
  14.             int SumOfTheSecondLine = array[1, 0] + array[1, 1] + array[1, 2];
  15.             int ProductOfTheFirstColumn = array[0, 0] * array[1, 0] * array[2, 0];
  16.             Console.WriteLine("Исходная матрица");
  17.             for (int i = 0; i < array.GetLength(0); i++)
  18.             {
  19.                 for (int j = 0; j < array.GetLength(1); j++)
  20.                 {
  21.                    
  22.                     Console.Write(array[i, j] + " ");
  23.                 }
  24.             }
  25.             Console.WriteLine("Сумма второй строки");
  26.             Console.WriteLine(SumOfTheSecondLine);
  27.             Console.WriteLine("Произведение первого столбца");
  28.             Console.WriteLine(ProductOfTheFirstColumn);
  29.             Console.ReadKey();
  30.           }
  31.  
  32.         }
  33.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement