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 _2.MissCat
- {
- class MissCat
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- List<int> votes = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- for (int i = 1; i <= n; i++)
- {
- int vote = int.Parse(Console.ReadLine());
- votes[vote - 1]++;
- }
- //index is zero based, so we have to add 1.
- int indexOfWinner = votes.IndexOf(votes.Max()) + 1;
- Console.WriteLine(indexOfWinner);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement