求两个集合的和(并集)、差、交集
set库提供set容器,iterator库提供迭代器,algorithm库提供集合操作(故也可以对其他容器进行集合操作)
#include <iostream>
#include <set>
#include <iterator>
#include <algorithm>
using namespace std;
//求两个集合的和(并集)、差、交集
//set库提供set容器,iterator库提供迭代器,algorithm库提供集合操作(故也可以对其他容器进行集合操作)
int main()
{
set<int> a, b;
set<int> c, d, e;
a.insert(1);
a.insert(2);
b