#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
vector<int> v{1, 2, 3, 4,5, 6, 7, 8, 9};
reverse(v.begin() + 2, v.begin() + 6);
for (auto const& v : v) cout << v << " ";
return 0;
}
/*
run:
1 2 6 5 4 3 7 8 9
*/