Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace День3Задание3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int sum = 0;
- int prod = 1;
- int[,] A = { {5,6,1},
- {3,2,7},// <-- сумма
- {4,8,9} };
- // ^- произведение
- for (int j = 0; j < A.GetLength(0) ; j++)
- {
- for (int i = 0; i < A.GetLength(1) ;i++)
- {
- Console.Write(A[j,i]);
- if (j == 1)
- {
- sum += A[1, i];
- }
- if (i == 0)
- {
- prod *= A[j,0];
- }
- }
- Console.WriteLine();
- }
- Console.WriteLine("sum = "+sum);
- Console.WriteLine("product = "+prod);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement