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