Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace C_Sharp_Junior
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[,] array = new int[10, 10];
- int maxValue = 0;
- Random random = new Random();
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- array[i, j] = random.Next(10, 99);
- if (maxValue < array[i, j])
- {
- maxValue = array[i, j];
- }
- Console.Write(array[i, j] + " ");
- }
- Console.WriteLine();
- }
- Console.WriteLine("\n\n");
- for (int i = 0; i < array.GetLength(0); i++)
- {
- for (int j = 0; j < array.GetLength(1); j++)
- {
- if (array[i, j] == maxValue)
- {
- Console.ForegroundColor = ConsoleColor.Red;
- array[i, j] = 0;
- }
- Console.Write(array[i, j] + " ");
- Console.ResetColor();
- }
- Console.WriteLine();
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment