Advertisement
Guest User

Untitled

a guest
May 9th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ArrayExercise
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var words = Console.ReadLine().ToLower().Split(' ');
  14. var allWords = new Dictionary<string, int>();
  15. foreach (var word in words)
  16. if (!allWords.ContainsKey(word))
  17.  
  18. allWords.Add(word, 1);
  19. else
  20. allWords[word]++;
  21. var result = new List<string>();
  22. foreach (var pair in allWords)
  23. {
  24. if (pair.Value % 2 == 1)
  25. {
  26. result.Add(pair.Key);
  27. }
  28. }
  29. Console.WriteLine(string.Join(", ", result));
  30. }
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement