#include #include #include #include //for ostream_iterator and reverse_iterator template #include using namespace std; int main() { const int a[] = {10, 20, 30}; const size_t n = sizeof a / sizeof a[0]; vector v(a, a + n); for (vector::reverse_iterator it = v.rbegin(); it != v.rend(); ++it) { cout << *it << "\n"; } cout << "\n"; copy(v.rbegin(), v.rend(), ostream_iterator(cout, "\n")); cout << "\n"; copy(reverse_iterator(a + n), reverse_iterator(a), ostream_iterator(cout, "\n")); return EXIT_SUCCESS; }