Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Author: Kanan Asgarli
- https://www.e-olymp.com/az/problems/1460
- */
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int n, m[1001], a, b, c, d;
- int main()
- {
- cin>>n>>a>>b>>c>>d;
- for(int i = 1; i <= n; i++){
- m[i] = i;
- }
- reverse(m+a,m+b+1);
- reverse(m+c,m+d+1);
- for(int i = 1; i <= n; i++){
- cout<<m[i]<<" ";
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment