Advertisement
Guest User

Neel Basu

a guest
Jul 15th, 2008
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <cstdlib>
  4. #include <string>
  5.  
  6. using std::cout;
  7. using std::cin;
  8. using std::endl;
  9. using std::vector;
  10. using std::string;
  11.  
  12. int main(int argc, char** argv){
  13.         vector<string> names;
  14.         names.push_back("5");
  15.         names.push_back("10");
  16.         names.push_back("15");
  17.         string age;
  18.         vector<string>::iterator it;
  19.         cin>>age;
  20.         for(it=names.begin();it < names.end();it++){
  21.           if(*it == age){
  22.             names.erase(it);
  23.           }
  24.         }
  25.         for(it=names.begin();it<names.end();it++){
  26.           cout<<*it<<endl;
  27.         }
  28.         return EXIT_SUCCESS;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement