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 ConsoleApplication3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int sum = 0;
- int proizv = 1;
- int[,] A = {
- {3,5,1 },
- {7,2,8 },
- {5,1,4 } };
- for (int i = 0; i < A.GetLength(0); i++)
- {
- for (int j = 0; j < A.GetLength(1); j++)
- {
- if (j==0)
- {
- proizv = proizv * A[i, j];
- }
- if (i==1)
- {
- sum = sum + A[i,j];
- }
- Console.Write(A[i, j] + " ");
- }
- Console.WriteLine();
- }
- Console.WriteLine("Сумма второй строки = " + sum + "\nПроизведение первого столбца = " + proizv);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement