Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <deque>
  4. #include <cstring>
  5. #include <algorithm>
  6. #define _USE_MATH_DEFINES
  7. #include <cmath>
  8. #include <fstream>
  9. #include <vector>
  10. using namespace std;
  11. int main(){
  12.     ifstream cin ("input.txt");
  13.     int k,m,n,l,o,i;
  14.     vector<int> a;
  15.  
  16.     cin>>n>>k>>m>>l>>o;
  17.  
  18.     a.push_back(0);
  19.  
  20.     for(i=1;i<=n;i++)
  21.          a.push_back(i);
  22.  
  23.     reverse(a.begin()+k,a.begin()+m+1);
  24.     reverse(a.begin()+l,a.begin()+o+1);
  25.  
  26.     for(i=1;i<=n;i++)
  27.          cout<<a[i]<<" ";
  28.     cout<<endl;
  29.  
  30.      return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement