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 CSLight
- {
- class Program
- {
- static void Main(string[] args)
- {
- int secondRowSum = 0;
- int firstColumnMultiply = 1;
- int[,] doubleArray = {
- { 1, 2, 3, 4, 5 },
- { 9, 8, 7, 6, 5 },
- { 5, 4, 6, 3, 7 }
- };
- for (int x = 0; x < doubleArray.GetLength(1); x++)
- {
- secondRowSum += doubleArray[1, x];
- }
- for (int x = 0; x < doubleArray.GetLength(0); x++)
- {
- firstColumnMultiply *= doubleArray[x, 0];
- }
- for (int x = 0; x < doubleArray.GetLength(0); x++)
- {
- for (int y = 0; y < doubleArray.GetLength(1); y++)
- {
- Console.Write(doubleArray[x, y] + " ");
- }
- Console.WriteLine();
- }
- Console.WriteLine("Произведение эл-ов 1го столбца = " + firstColumnMultiply);
- Console.WriteLine("Сумма эл-ов 2й строки = " + secondRowSum);
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment