/***************************************************************************
 * This program illustrates reverse iterators
 ***************************************************************************/
#include <iostream>
#include <vector>

using std::cin;           
using std::cout;            
using std::endl;            
using std::vector;

void show_vec(const vector<int>& vec);

int main()
{

	vector<int> custom;
	int x;
	cout<<"\nPlease enter space-separated integers, and 's' to stop:";
	while(cin>>x)
		custom.push_back(x);//Load 'custom' from the keyboard.
	cout<<"The vector 'custom' contains\n";
	show_vec(custom);
	cout<<"\nIn reverse order, \n";
	for(vector<int>::reverse_iterator riter=custom.rbegin();
			riter!=custom.rend(); riter++)
	cout<<*riter<<" ";
	return 0;
	

	
}

void show_vec(const vector<int>& v)
{
	for(vector<int>::const_iterator iter=v.begin(); iter!=v.end();++iter)
		cout<<*iter<<" ";
	
	return;
}
	
