Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp5
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[10, 10];
- Console.WriteLine("Заполните массив:");
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- array[i, j] = Convert.ToInt32(Console.ReadLine());
- }
- }
- 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] + " ");
- }
- Console.WriteLine();
- }
- int maxNumbers = int.MinValue;
- int iMaxNumbers = 0; int jMaxNumbers = 0;
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- if (array[i, j] > maxNumbers)
- {
- maxNumbers = array[i, j];
- iMaxNumbers = i; jMaxNumbers = j;
- }
- }
- }
- Console.WriteLine("Наибольший элимент матрицы - " + array[iMaxNumbers, jMaxNumbers]);
- array[iMaxNumbers, jMaxNumbers] = 0;
- 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] + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement