Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [StatrCode]
- using System;
- namespace ConsoleApp13
- {
- internal class Program
- {
- static void Main(string[] args)
- {
- Random randomNumber = new Random();
- int[,] array = new int[3, 3];
- int secondLineSum=0;
- int secondLine = 1;
- int multiplyingFirstColumn=1;
- int firstColumn = 0;
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- array[i, j] = randomNumber.Next(10);
- }
- }
- Console.WriteLine("Дан массив : ");
- for (int i = 0;i < array.GetLength(0); i++)
- {
- for(int j = 0;j < array.GetLength(1); j++)
- {
- Console.Write(array[i,j]+ " ");
- }
- Console.WriteLine();
- }
- Console.WriteLine();
- for (int i = 0;i< array.GetLength(1); i++)
- {
- secondLineSum += array[secondLine, i];
- }
- Console.WriteLine($"Сумма второй строки данного массива : {secondLineSum}");
- Console.WriteLine();
- for (int i = 0; i < array.GetLength(0); i++)
- {
- multiplyingFirstColumn *= array[i, firstColumn];
- }
- Console.WriteLine($"Произведение первого столбца : {multiplyingFirstColumn}");
- }
- }
- }
- [EndCode]
Advertisement
Add Comment
Please, Sign In to add comment