#include #include #include using namespace std; int main() { int i; set::iterator it; set mySet; set set2; set set3; set set6; set set9; for (i = 15; i < 100; i++) mySet.insert(i); for (it = mySet.begin(); it != mySet.end(); it++) { if (*it % 2 == 0) set2.insert(*it); if (*it % 3 == 0) set3.insert(*it); if (*it % 6 == 0) set6.insert(*it); if (*it % 9 == 0) set9.insert(*it); } for (it = set2.begin(); it != set2.end(); it++) cout << *it << " "; cout << endl; for (it = set3.begin(); it != set3.end(); it++) cout << *it << " "; cout << endl; for (it = set6.begin(); it != set6.end(); it++) cout << *it << " "; cout << endl; for (it = set9.begin(); it != set9.end(); it++) cout << *it << " "; cout << endl; return 0; }