Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class MainClass {
- public static void Main (string[] args) {
- int [,] matrix = new int[3,3];
- int summ2 =0;
- int proizvedenie1 = 1;
- Random rnd = new Random ();
- Console.WriteLine("Исходная матрица\n");
- for (int x=0; x< matrix.GetLength(0);x++)
- {
- for (int y=0; y < matrix.GetLength(1);y++)
- {
- matrix [x,y] = rnd.Next(0,10);
- Console.Write(matrix[x,y] + " ");
- }
- Console.WriteLine();
- }
- for (int y=0;y<matrix.GetLength(1);y++)
- {
- summ2 += matrix [1,y];
- }
- for (int x=0;x<matrix.GetLength(0);x++)
- {
- proizvedenie1 = proizvedenie1 * matrix [x,0];
- }
- Console.WriteLine("Сумма второй строки = " + summ2);
- Console.WriteLine("Произведение первого столбца = " + proizvedenie1);
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement