|
|
вернуться в форумC# Accepted using System; using System.Collections.Generic; namespace CA_TimusRu { class Program1496 { static void Main(string[] args) { Dictionary<string, int> dict = new Dictionary<string, int>(); int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) { string s = Console.ReadLine(); if (dict.ContainsKey(s)) dict[s]++; else dict.Add(s, 1); } foreach (var item in dict) { if (item.Value >= 2) Console.WriteLine(item.Key); } } } } |
|
|