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