Last active
October 18, 2022 12:40
-
-
Save Velsimir/81236585c6a90f763908daa5487adc3a to your computer and use it in GitHub Desktop.
This file contains 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.Collections.Generic; | |
using System.Security.Policy; | |
using System.Threading; | |
namespace iJunior | |
{ | |
class MainClass | |
{ | |
public static void Main(string[] args) | |
{ | |
int[,] array = | |
{ | |
{1, 2, 3, 4, 5 }, | |
{7, 8, 9, 10, 11 }, | |
{12, 13, 14, 15, 16 } | |
}; | |
int sumSecondString = 0; | |
int multipleFirstColumn = 1; | |
int maxLenghtSecondString = array.GetLength(1); | |
int maxLenghtColumns = array.GetLength(0); | |
for (int i = 0; i < maxLenghtColumns; i++) | |
{ | |
for (int j = 0; j < maxLenghtSecondString; j++) | |
{ | |
Console.Write(array[i,j]); | |
Console.Write("\t"); | |
} | |
Console.WriteLine(); | |
} | |
for (int i = 0; i < maxLenghtSecondString; i++) | |
{ | |
sumSecondString += array[1, i]; | |
} | |
for (int i = 0; i < maxLenghtColumns; i++) | |
{ | |
multipleFirstColumn *= array[i, 0]; | |
} | |
Console.WriteLine($"Сумма второй строки = {sumSecondString}"); | |
Console.WriteLine($"Произведений первого столбца = {multipleFirstColumn}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment