nassss

Untitled

Mar 19th, 2020
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. namespace EvenTimes
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. int n = int.Parse(Console.ReadLine());
  12. var dict = new Dictionary<int, int>();
  13.  
  14. for (int i = 0; i < n; i++)
  15. {
  16. var input = int.Parse(Console.ReadLine());
  17. if (dict.ContainsKey(input))
  18. {
  19. dict[input] +=1;
  20. }
  21. else
  22. {
  23. dict.Add(input, 1);
  24. }
  25.  
  26. }
  27. foreach (var item in dict)
  28. {
  29. if (item.Value % 2 ==0)
  30. {
  31. Console.WriteLine(item.Key);
  32. }
  33.  
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment