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