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