Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
#include
#include
#include
using namespace std; int main() { vector
values = {'1', '2', '3', '4', 'w', 'x', 'y', 'z'}; swap_ranges(values.begin() + 1, values.begin() + 3, values.begin() + 5); for (char item : values) { cout << item << " "; } return 0; }
1 x y 4 w 2 3 z