Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[5, 5];
- Random ran = new Random();
- int sumLine = 0;
- int tableColumn = 1;
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- array[i, j] = ran.Next(1, 9);
- if (i == 1) { sumLine += array[i, j]; }
- if (j == 1) { tableColumn *= array[i, j];}
- Console.Write(array[i,j] + " ") ;
- }
- Console.WriteLine("");
- }
- Console.WriteLine("Сумма второй строки - " + sumLine);
- Console.WriteLine("Произведение второго столбца - " + tableColumn);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement