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 ijunior3._1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] arr = new int [5,5];
- Random rand = new Random();
- int sum = 0;
- int mutiplication = 0;
- for (int i = 0; i < arr.GetLength(0); i++)
- {
- for ( int j = 0; j < arr.GetLength(1); j++)
- {
- arr[i, j] = rand.Next(0, 10);
- Console.Write(arr[i, j] + " ");
- }
- Console.WriteLine();
- }
- sum = arr[1, 0] + arr[1, 1] + arr[1, 2] + arr[1, 3] + arr[1, 4];
- mutiplication = arr[0, 0] * arr[1, 0] * arr[2, 0] * arr[3, 0] * arr[4, 0];
- Console.WriteLine("\nСумма второй строки : " + sum + "\nПроизведение первого столбца: " + mutiplication +"\n");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement