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