static void Main(string[] args) { IntSet A = new IntSet(33); IntSet B = new IntSet(33); A.Insert(5); A.Insert(30); A.Insert(23); B.Insert(5); B.Insert(24); B.Insert(9); Console.WriteLine("A集合:{0};{1}", A.GetBitString(), A.GetElements()); Console.WriteLine("B集合:{0};{1}", B.GetBitString(), B.GetElements()); IntSet C; C = A.Union(B); Console.WriteLine("A并B :{0}:{1}", C.GetBitString(), C.GetElements()); C = A.Intersect(B); Console.WriteLine("A交B :{0}:{1}", C.GetBitString(), C.GetElements()); C = A.DiffSet(B); Console.WriteLine("A差B :{0}:{1}", C.GetBitString(), C.GetElements()); C = A.Complement(); Console.WriteLine("A的补:{0}:{1}", C.GetBitString(), C.GetElements()); }