Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args)
- {
- Dictionary<string, int> dic = new Dictionary<string, int>();
- for (int i = 0; i < 5; i++)
- {
- /*your code to retrive the numbers*/
- if (!dic.ContainsKey(number))
- dic.Add(number);
- dic[number]++;
- }
- Console.WriteLine(dic.Aggregate((l1, l2) => l1.Value > l2.Value ? l1 : l2).Key);
- }
Advertisement
Add Comment
Please, Sign In to add comment