//DISPLAY 18.12 Program Using the set Template Class //Program to demonstrate use of the set template class. #include #include using std::cout; using std::endl; using std::set; int main( ) { set s; s.insert('A'); s.insert('D'); s.insert('D'); s.insert('C'); s.insert('C'); s.insert('B'); cout << "The set contains:\n"; set::const_iterator p; for (p = s.begin( ); p != s.end( ); p++) cout << *p << " "; cout << endl; cout << "Removing C.\n"; s.erase('C'); for (p = s.begin( ); p != s.end( ); p++) cout << *p << " "; cout << endl; return 0; }