Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace C_Ijun
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- int[,] twoSizeArray = new int[4, 4];
- int rowSum = 0;
- int colMult = 1;
- int lowRangeRandom = 0;
- int highRangeRandom = 10;
- int arrayIndBySum = 2;
- int arrayIndByMulti = 1;
- Random random = new Random();
- for (int i = 0; i < twoSizeArray.GetLength(0); i++)
- {
- for (int j = 0; j < twoSizeArray.GetLength(1); j++)
- {
- twoSizeArray[i, j] = random.Next(lowRangeRandom, highRangeRandom);
- }
- }
- for (int i = 0; i < twoSizeArray.GetLength(0); i++)
- {
- for (int j = 0; j < twoSizeArray.GetLength(1); j++)
- {
- Console.Write(twoSizeArray[i, j] + " ");
- }
- Console.WriteLine();
- }
- for (int j = 0; j < twoSizeArray.GetLength(1); j++)
- {
- rowSum += twoSizeArray[arrayIndBySum - 1, j];
- }
- for (int i = 0; i < twoSizeArray.GetLength(0); i++)
- {
- colMult *= twoSizeArray[i, arrayIndByMulti - 1];
- }
- Console.WriteLine($"Сумма чисел строки {arrayIndBySum} - {rowSum}");
- Console.WriteLine($"Произведение чисел столбца {arrayIndByMulti} - {colMult}");
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement