Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define Line cout << endl << "-------------------------------------------\n\n"
- #define forn(i, n) for(int i = 0; i < int(n);i++)
- const int INF = 1e9 + 13;
- const int N = 1e5 + 13;
- int main(){
- int n; cin >> n;
- vector<int> a(n);
- forn(i, n)
- cin >> a[i];
- for(vector<int>::iterator it = a.begin(); it != a.end(); it++)
- {
- vector<int>::iterator tmp = it;
- iter_swap(it++, ++tmp);
- }
- forn(i, n)
- cout << a[i] << ' ';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement