1#include <iostream>
2#include <vector>
3
4using namespace std;
5
6int main(void) {
7 vector<int> v = {1, 2, 3, 4, 5};
8
9 /* Iterate vector in reverse order */
10 for (auto it = v.rbegin(); it != v.rend(); ++it)
11 cout << *it << endl;
12
13 /* Iterate vector in reverse order */
14 for(int i = v.size() - 1; i >= 0; i--)
15 std::cout << v[i] << endl;
16
17 return 0;
18}