#include <iostream>
#include <set>
using namespace std;
void printSet(set<int> st) {
for (auto n: st) {
cout << n << ' ' ;
}
}
int main ()
{
set<int> st;
for (int i = 1; i < 10; i++)
st.insert(i);
printSet(st);
st.erase(8);
std::set<int>::iterator it;
it = st.find(7);
st.erase(it, st.end());
cout << endl;
printSet(st);
return 0;
}
/*
run:
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6
*/