Advertisement
Guest User

3,2

a guest
Oct 14th, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 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 СSLight13
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int d = 0;
  14.             int e = 1;
  15.  
  16.             int[,] array = new int[3, 3];
  17.             Random random = new Random();
  18.  
  19.             for (int i = 0; i < array.GetLength(0); i++)
  20.             {
  21.                 for (int j = 0; j < array.GetLength(1); j++)
  22.                 {
  23.                     array[i, j] = random.Next(0, 10);
  24.  
  25.                     Console.Write(array[i, j] + " ");
  26.                    
  27.                 }
  28.                 Console.WriteLine();
  29.                 d = d + array[0, i];
  30.             }
  31.             for (int j = 0; j < array.GetLength(1); j++)
  32.             {
  33.                 e = e * array[j, 0];
  34.             }
  35.  
  36.             Console.WriteLine("Сумма первой строки = " + d);
  37.             Console.WriteLine("Произведение второго столбца = " + e);
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement