1#include <iostream>
2#include <vector>
3
4using namespace std;
5
6int main()
7{
8 vector<int> g1;
9
10 for (int i = 1; i <= 5; i++)
11 g1.push_back(i);
12
13 cout << "Output of begin and end: ";
14 for (auto i = g1.begin(); i != g1.end(); ++i)
15 cout << *i << " ";
16
17 cout << "\nOutput of cbegin and cend: ";
18 for (auto i = g1.cbegin(); i != g1.cend(); ++i)
19 cout << *i << " ";
20
21 cout << "\nOutput of rbegin and rend: ";
22 for (auto ir = g1.rbegin(); ir != g1.rend(); ++ir)
23 cout << *ir << " ";
24
25 cout << "\nOutput of crbegin and crend : ";
26 for (auto ir = g1.crbegin(); ir != g1.crend(); ++ir)
27 cout << *ir << " ";
28
29 return 0;
30}