Advertisement
LeRoY_Go

Untitled

Jan 29th, 2022
1,164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. using System;
  2.  
  3. namespace C_Sharp_Junior
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int[,] array = { { 2, 9, 3 }, { 8, 2, 3 }, { 2, 2, 3 } };
  10.             int sumLine = 0;
  11.             int derivativeColumn = 1;
  12.             for (int i = 0; i < array.GetLength(0); i++)
  13.             {
  14.                 for (int j = 0; j < array.GetLength(1); j++)
  15.                 {
  16.                     Console.Write(array[i, j] + " ");
  17.                 }
  18.                 Console.WriteLine();
  19.             }
  20.             for (int j = 0; j < array.GetLength(1); j++)
  21.             {
  22.                 sumLine += array[1, j];
  23.             }
  24.             for (int i = 0; i < array.GetLength(0); i++)
  25.             {
  26.  
  27.                 derivativeColumn *= array[i, 0];
  28.  
  29.             }
  30.             Console.WriteLine("Сумма 2 строки: " + sumLine);
  31.             Console.WriteLine("Производная 1 столбца: " + derivativeColumn);
  32.             Console.ReadKey();
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement