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