#include <iostream>
#include <set>
using namespace std;
void printSet (set<int> s)
{
for (set<int>::iterator it = s.begin(); it != s.end(); it ++)
{
cout << *it << " ";
}
cout << endl;
}
void test01 ()
{
set<int> s1;
s1.insert(1);
s1.insert(2);
s1.insert(3);
s1.insert(1);
s1.insert(4);
printSet(s1);
cout << (s1.empty() ? "empty" : "not empty") << endl;
}
void test02 ()
{
set<int> s1;
s1.insert(1);
s1.insert(2);
s1.insert(3);
s1.insert(1);
s1.insert(4);
printSet(s1);
set<int> s2;
s2.insert(11);
s2.insert(21);
s2.insert(31);
s2.insert(11);
s2.insert(41);
printSet(s2);
s1.swap(s2);
printSet(s1);
printSet(s2);
}
int main ()
{
test02();
return 0;
}