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 Learn1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = { {1,2,3,4,5}, {4,5,6,7,8}, {2,1,3,5,6}};
- int summ = 0;
- int composition = 1;
- 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();
- }
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- if (i == 1)
- {
- summ += array[i, j];
- }
- if (j == 0)
- {
- composition *= array[i, j];
- }
- }
- }
- Console.WriteLine("Произвеление первого столбца: " + composition);
- Console.WriteLine("Сумма второй строки:" + summ);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment