#include #include #include using namespace std; ostream & operator<<(ostream & os, vector & v) { os << "["; for(auto &i: v) { os << i << ", "; } os << "]"; return os; } int main() { vector people = { "bilbo", "frodo", "samwise", "gandalf", "aragorn", "aowen", "gollum", "gimli", "legalos", }; cout << people << endl; vector::iterator it = find(people.begin(), people.end(), "gandalf"); if(it != people.end()) people.erase(it); cout << people << endl; it = find(people.begin(), people.end(), "frodo"); if(it != people.end()) people.erase(it); cout << people << endl; it = find(people.begin(), people.end(), "Lord Voldemort"); if(it != people.end()) people.erase(it); cout << people << endl; }