Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[,] matrix = {
- { 2, 2, 3 },
- { 5, 5, 10 },
- { 3, 5, 4 },
- { 7, 2, 3 }
- };
- int lineIndexMatrix = 1;
- int columIndexMatrix = 0;
- int multiplyColumnMatrix = 1;
- int sumLineMatrix = 0;
- for (int i = 0; i < matrix.GetLength(1); i++)
- {
- sumLineMatrix += matrix[lineIndexMatrix, i];
- }
- for (int i = 0; i < matrix.GetLength(0); i++)
- {
- multiplyColumnMatrix *= matrix[i, columIndexMatrix];
- }
- for (int i = 0; i < matrix.GetLength(0); i++)
- {
- for (int j = 0; j < matrix.GetLength(1); j++)
- {
- Console.Write(matrix[i, j] + " ");
- }
- Console.WriteLine();
- }
- Console.WriteLine($"\nСумма {lineIndexMatrix + 1} строки: {sumLineMatrix}\nПроизведение {columIndexMatrix + 1} " +
- $"столбца: {multiplyColumnMatrix}\n");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement