Advertisement
SnowPhoenix347

3.3

Oct 29th, 2019
131
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 FifthProject
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int sum1 = 0;
  14.             int sum2 = 1;
  15.  
  16.             int[,] array =
  17.                 {
  18.                 {4,5,7},
  19.                 {2,2,6},
  20.                 {1,3,3}
  21.                 };
  22.  
  23.             Console.WriteLine("Матрица исходная: ");
  24.             for (int i = 0; i < array.GetLength(0); i++)
  25.             {
  26.                 for (int j = 0; j < array.GetLength(1); j++)
  27.                 {
  28.                     Console.Write(array[i, j]);
  29.                 }
  30.                 Console.WriteLine();
  31.             }
  32.  
  33.             for (int i = 0; i < array.GetLength(1); i++)
  34.             {
  35.                 sum1 += array[1, i];
  36.             }
  37.             for (int i = 0; i < array.GetLength(1); i++)
  38.             {
  39.                 sum2 *= array[i, 0];
  40.             }
  41.  
  42.             Console.WriteLine(sum1);
  43.             Console.WriteLine(sum2);
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement