#include<vector>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
vector<int> v;
int h;
// Illustrates pus_back() function
for(int j=0; j<5; j++)
{
cin>>h;
v.push_back(h);
}
ostream_iterator<int>out(cout, " ");
cout<<"Elements of Vector\n";
copy(v.beign(), v.end(),out);
vector<int>::iterator i = v.begin();
// find whether an element 30 is present in the vector
vector<int>::iterator p = find(v.begin(), v.end(), 30);
// p iterator points to the position of 1st occurrence of element 30
cout<<"\n\n";
p=v.inser(p, 25);
// Insert element 25 at position 'p' and update positon 'p'
cout<<"Element of the vector after insertion of element 25\n";
copy(v.begin(), v.end(), out);
cout(v.begin(), v.end(),out);
cout<<"\n\n";
vector<int>::iterator q=v.begin();
q=v.erase(p-1);
/* remove the element pointed to by p-1 this returns an iterator to the element after the one removed */
cout<<"Element after erasing the element pointed to by position p-1\n";
copy(v.begin(), v.end(), out);
cout<<"\n\n";
cout<<"Value of q is :"<<*q<<"\n\n";
/* insert 15 four times before position q */
v.insert(q, 4, 15);
cout<<"Elements after inserting the integer 15 four four times \n;
copy(v.begin(), v.end(), out);
}