Advertisement
dxoraxs

Untitled

Apr 12th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace homework
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int[,] A = {
  10.             {1,2,3 },
  11.             {4,5,6 },
  12.             {7,8,9 }};
  13.             int summ=0, multip=1;
  14.             for (int i=0;i<A.GetLength(0);i++)
  15.             {
  16.                 for (int j=0;j<A.GetLength(1);j++)
  17.                 {
  18.                     if (i == 1) summ += A[i, j];
  19.                     if (j == 0) multip *= A[i, j];
  20.                     Console.Write(A[i,j]+" ");
  21.                 }
  22.                 Console.WriteLine();
  23.             }
  24.             Console.WriteLine("Сумма равна = "+summ);
  25.             Console.WriteLine("Произведение = "+multip);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement