using System.Collections.Generic;
public static void Main()
HashSet<int> set1 = new HashSet<int>() {1, 2, 3};
HashSet<int> set2 = new HashSet<int>() {2, 3, 4};
HashSet<int> union = new HashSet<int>(set1);
HashSet<int> intersection = new HashSet<int>(set1);
intersection.IntersectWith(set2);
Console.WriteLine("Obedinenie: ");
Console.WriteLine("Sechenie: ");
foreach (int i in intersection)