Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace EvenTimes
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- var dict = new Dictionary<int, int>();
- for (int i = 0; i < n; i++)
- {
- var input = int.Parse(Console.ReadLine());
- if (dict.ContainsKey(input))
- {
- dict[input] +=1;
- }
- else
- {
- dict.Add(input, 1);
- }
- }
- foreach (var item in dict)
- {
- if (item.Value % 2 ==0)
- {
- Console.WriteLine(item.Key);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment