Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int sum = 0;
- int product = 1;
- int[,] array = new int[3,3];
- Random random = new Random();
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- array[i,j] = random.Next(0, 20);
- Console.Write(array[i,j] + " ");
- }
- Console.WriteLine();
- }
- for (int j = 0; j < array.GetLength(1); j++)
- {
- sum += array[1, j];
- }
- for (int i = 0; i < array.GetLength(0); i++)
- {
- product *= array[i, 0];
- }
- Console.WriteLine($"\nСумма второй строки = {sum}, произведение первого столбца = {product}");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement