#include #include #include using namespace std; int main() { //Initialize some sets int a1[10] = {1,2,3,4,5,6,7,8,9,10}; int a2[6] = {2,4,6,8,10,12}; set s1(a1, a1+10), s2(a2, a2+6),answer ; cout << "s1="; copy(s1.begin(), s1.end(), ostream_iterator(cout," ")); cout << "\ns2="; copy(s2.begin(), s2.end(), ostream_iterator(cout," ")); //Demonstrate set_difference set_difference(s1.begin(), s1.end(), s2.begin(), s2.end(), inserter(answer,answer.begin())); cout << "\nThe set-difference of s1 and s2 ="; copy(answer.begin(), answer.end(), ostream_iterator(cout," ")); cout << endl; return 0; }