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 MissCat2011
- {
- class MissCat2011
- {
- static void Main(string[] args)
- {
- int people = int.Parse(Console.ReadLine());
- int[] cat = new int[11];
- for (int i = 1; i <= people; i++)
- {
- byte vote = byte.Parse(Console.ReadLine());
- cat[vote]++;
- }
- int bestCat = 0;
- int bestCatVotes = 0;
- for (int i = 0; i < cat.Length; i++)
- {
- if (cat[i] > bestCatVotes)
- {
- bestCat = i;
- bestCatVotes = cat[i];
- }
- }
- Console.WriteLine(bestCat);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment