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