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;
- class MissCat2011
- {
- static void Main(string[] args)
- {
- int N = int.Parse(Console.ReadLine());
- int[] cats = new int[10];
- int currentVote;
- for (int i = 0; i < N; i++)
- {
- currentVote = int.Parse(Console.ReadLine());
- switch (currentVote)
- {
- case 1: cats[0]++;
- break;
- case 2: cats[1]++;
- break;
- case 3: cats[2]++;
- break;
- case 4: cats[3]++;
- break;
- case 5: cats[4]++;
- break;
- case 6: cats[5]++;
- break;
- case 7: cats[6]++;
- break;
- case 8: cats[7]++;
- break;
- case 9: cats[8]++;
- break;
- case 10: cats[9]++;
- break;
- }
- }
- int winnerNumber = Array.IndexOf(cats, cats.Max()) + 1;
- Console.WriteLine(winnerNumber);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement