Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- do
- {
- n = Convert.ToInt32(Console.ReadLine());
- } while (n <= 10);
- int[] array = new int[n];
- for (int i = 0; i < n; i++)
- array[i] = Convert.ToInt32(Console.ReadLine());
- var query = array.GroupBy(item => item).OrderByDescending(g => g.Count()).Select(g => g.Key).First();
- Console.WriteLine(query);
- Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement