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