Advertisement
desislava_topuzakova

04

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