Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _01.Odd_Occurences
- {
- class Program
- {
- static void Main(string[] args)
- {
- var input = Console.ReadLine().ToLower().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
- var words = new Dictionary<string,int>();
- foreach (var word in input)
- {
- if (words.ContainsKey(word))
- {
- words[word]++;
- }
- else
- {
- words[word] = 1;
- }
- }
- var result = new List<string>();
- foreach (var pair in words)
- {
- if (pair.Value % 2 == 1)
- {
- result.Add(pair.Key);
- }
- }
- Console.Write(string.Join(", ", result));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement