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 array10x10
- {
- class Program
- {
- static void Main(string[] args)
- {
- int maxValue = int.MinValue;
- int saveX = 0;
- int saveY = 0;
- int[,] array = {
- {1,2,3,4,5,355,2,5,7,4},
- {5,5,8,3,4,3,5,6,4,3},
- {9,553,7,4,4,2,5,6,3,5},
- {3,5,5,4,8,9,4,665,7,4},
- {4,6,8,445,7,5,6,3,6,4},
- {4,6,7,4,6,7,6,6,4,6},
- {6,5,3,5,3,5,3,6,3,1},
- {6,5,5,5,3,5,3,6,3,1},
- {5,5,8,3,4,3,5,6,555,3},
- {3,5,5,6,8,5,999,6,8,9} };
- for (int i = 0; i != array.GetLength(0); i++)
- {
- for (int j = 0; j != array.GetLength(1); j++)
- {
- if (array[i, j] > maxValue)
- {
- maxValue = array[i, j];
- saveX = i;
- saveY = j;
- }
- }
- }
- array[saveX, saveY] = 0;
- 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();
- }
- Console.SetCursorPosition(0, 12);
- Console.WriteLine(maxValue);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement