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 _7.Odd_Occurrences
- {
- class Program
- {
- static void Main(string[] args)
- {
- var text = Console.ReadLine().ToLower();
- var words = text.Split(' ');
- var counts = new Dictionary<string, int>();
- foreach (var w in words)
- {
- if (counts.ContainsKey(w)) counts[w]++;
- else counts[w] = 2;
- }
- var list = new List<string>();
- foreach (var pair in counts)
- {
- if (pair.Value % 2 !=0)
- {
- list.Add(pair.Key);
- }
- }
- Console.WriteLine(string.Join(", ",list));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement