Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApplication2
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] matrix = {
- { 0, 1, 2 },
- { 3, 4, 5 },
- { 6, 7, 8 }
- };
- int sum = 0, prod = 1;
- for (int j = 0; j < 3; j++)
- sum += matrix[1, j];
- for (int i = 0; i < 3; i++)
- prod *= matrix[i, 0];
- Console.WriteLine("Сумма элементов второй строки равна " + sum + ", Произведение элементов первого столбца равно " + prod);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment