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