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 ConsoleApp3
- {
- class Program
- {
- static void Main(string[] args)
- {
- int max = 0;
- Random rand = new Random();
- int[,] array = new int[10,10];
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- array[i, j] = rand.Next(10, 99);
- Console.Write(array[i, j] + " ");
- if (max < array[i, j])
- {
- max = array[i, j];
- }
- }
- Console.WriteLine();
- }
- Console.WriteLine("Максимальное число в массиве: " + max);
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- if (max < array[i, j])
- {
- max = array[i, j];
- }
- if (max == array[i, j])
- {
- array[i, j] = 0;
- }
- Console.Write(array[i, j] + " ");
- }
- Console.WriteLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement