asgarlikanan

https://www.e-olymp.com/az/problems/1460

Aug 19th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
4CS 0.37 KB | None | 0 0
  1. /*
  2.     Author: Kanan Asgarli
  3.     https://www.e-olymp.com/az/problems/1460
  4. */
  5. #include <iostream>
  6. #include <algorithm>
  7. using namespace std;
  8. int n, m[1001], a, b, c, d;
  9. int main()
  10. {
  11.     cin>>n>>a>>b>>c>>d;
  12.     for(int i = 1; i <= n; i++){
  13.         m[i] = i;
  14.     }
  15.     reverse(m+a,m+b+1);
  16.     reverse(m+c,m+d+1);
  17.     for(int i = 1; i <= n; i++){
  18.         cout<<m[i]<<" ";
  19.     }
  20.        
  21.     return 0;
  22. }
Add Comment
Please, Sign In to add comment