Skip to content

Instantly share code, notes, and snippets.

@RaitonFan
Created April 25, 2025 22:33
Show Gist options
  • Save RaitonFan/d0efd343d8c1ae1cf9422dca81f1db97 to your computer and use it in GitHub Desktop.
Save RaitonFan/d0efd343d8c1ae1cf9422dca81f1db97 to your computer and use it in GitHub Desktop.
ДЗ: Работа с конкретными строками/столбцами 2
using System;
using System.Diagnostics.Eventing.Reader;
namespace HelloWorld
{
internal class Program
{
public static void Main()
{
int productOfFirstString = 1;
int sumOfSecondString = 0;
int[,] arrayNumbers = new int[,]{
{2,3,3,1,4 },
{4,1,2,6,3}};
for (int i = 0; i < arrayNumbers.GetLength(1); i++)
{
sumOfSecondString += arrayNumbers[1,i];
}
for (int i = 0; i < arrayNumbers.GetLength(1); i++)
{
productOfFirstString *= arrayNumbers[0, i];
}
Console.WriteLine($"Произведение чисел первой строки - {productOfFirstString}\nСумма чисел второй строки - {sumOfSecondString}.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment