#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main ()
{
  vector<int> myvector;
  int myint;
  cout << "Please enter some integers (enter 0 to end):\n";
for (int i=0; i<5; i++){
    cin >> myint;
    myvector.push_back (myint);
  }

  cout << "myvector stores " << int(myvector.size()) << " numbers.\n";
for (vector<int>::iterator it = myvector.begin() ; it != myvector.end(); ++it)
    cout << ' ' << *it;\
  cout << endl;
for (int i=0; i<5; i++){
  cout << myvector [i]; }
  cout << endl;
  myvector.pop_back();
  for (vector<int>::iterator it = myvector.begin() ; it != myvector.end(); ++it)
    cout << ' ' << *it;\
  cout << endl;
  if(myvector.empty())
  cout << endl;
  cout << myvector.back();
  cout << endl;
  cout << myvector.front();
  cout << endl;
  sort (myvector.begin(), myvector.end());
  cout << endl;
  for (vector<int>::iterator it = myvector.begin() ; it != myvector.end(); ++it)
    cout << ' ' << *it;\
    cout << endl;
   
  cout << myvector.size();
  cout << endl;
  int searchValue;
  cout << "Enter a value to search for";
  cin >> searchValue;
 vector<int>::iterator it= find(myvector.begin(), myvector.end(), searchValue);
 if ( it == myvector.end() )
 cout << "Value found";
 else (cout << "Value is not found");
  cout << endl;
  myvector.clear();
}