1#include <bits/stdc++.h> // Vector
2#include <algorithm> // Reverse
3using namespace std;
4
5int main()
6{
7 vector<int> nums{4,1,2,1,2};
8
9 reverse(nums.begin(), nums.end());
10 return 0;
11}
12
1#include <iostream>
2#include <algorithm>
3#include <vector>
4#include <iterator>
5using namespace std;
6int main()
7{
8 vector<int>a = {11,22,33,44,99,55};
9 reverse(a.begin(), a.end());
10 auto it = a.begin();
11 for(it= a.begin(); it!=a.end(); it++){
12 cout << *it << ' ';
13 }
14}
15