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)
- {
- //a = new int[n, n];
- //int[] s = new int[n];
- int[,] array = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 9 } };
- int Sum = 0;
- int Pro = 1;
- int a = array.GetLength(0)-1;
- int b = array.GetLength(1)-1;
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- Console.Write(array[i, j] + " ");
- }
- Console.WriteLine();
- }
- for (int i = 0; i < array.GetLength(0); i++)
- {
- Pro *= array[i, 1];
- }
- for (int j = 0; j < array.GetLength(0); j++)
- {
- Sum += array[0, j];
- }
- Console.WriteLine($"\nСумма второй строки равна { Sum }");
- Console.WriteLine($"Произведение первого столбца равно { Pro }");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement