Advertisement
mivak

MissCat

Apr 1st, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. namespace Problem2MissCat
  2. {
  3. using System;
  4. using System.Linq;
  5. class Problem2MissCat
  6. {
  7. static void Main()
  8. {
  9. int n = int.Parse(Console.ReadLine());
  10. int[] cats = new int[10];
  11. int currentVote = 0;
  12. for (int i = 0; i < n; i++)
  13. {
  14. currentVote = int.Parse(Console.ReadLine());
  15. switch (currentVote)
  16. {
  17. default: cats[currentVote - 1]++;
  18. break;
  19. }
  20. }
  21. Console.WriteLine(Array.IndexOf(cats, cats.Max()) + 1);
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement