Guest User

Untitled

a guest
Jan 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. static void Main(string[] args)
  2. {
  3. Dictionary<string, int> dic = new Dictionary<string, int>();
  4. for (int i = 0; i < 5; i++)
  5. {
  6. /*your code to retrive the numbers*/
  7. if (!dic.ContainsKey(number))
  8. dic.Add(number);
  9. dic[number]++;
  10. }
  11. Console.WriteLine(dic.Aggregate((l1, l2) => l1.Value > l2.Value ? l1 : l2).Key);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment