archangelmihail

MissCat

Nov 30th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace MissCat
  8. {
  9.     class MissCat
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int[] cats = new int[10];
  14.             int number = int.Parse(Console.ReadLine());
  15.             int vote = 0;
  16.             int winner = 0;
  17.             int score = 0;
  18.             while (number >0)
  19.             {
  20.                 vote = int.Parse(Console.ReadLine()) - 1;
  21.                 cats[vote] = cats[vote] + 1;
  22.                 if (cats[vote] > score)
  23.  
  24.  
  25.                 {
  26.                     score = cats[vote];
  27.                     winner = vote +1;
  28.                 }
  29.                 number--;
  30.             }
  31.             Console.WriteLine(winner);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment