Created
April 25, 2025 22:33
-
-
Save RaitonFan/d0efd343d8c1ae1cf9422dca81f1db97 to your computer and use it in GitHub Desktop.
ДЗ: Работа с конкретными строками/столбцами 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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