#include
#include
#include // for find
#include
using namespace std;
int main()
{
string s("It is him.");
vector vector1(s.begin(), s.end());
ostream_iterator out(cout, " ");
cout << "chars from the last t to the beginning: ";
vector::reverse_iterator r = find(vector1.rbegin(), vector1.rend(), 't'
);
copy(r, vector1.rend(), out); cout << endl;
cout << "chars from the last t to the end: ";
copy(r.base() - 1, vector1.end(), out); cout << endl;
return 0;
}
chars from the last t to the beginning: t I
chars from the last t to the end: t i s h i m .