fork download
  1. #include <vector>
  2. #include <algorithm>
  3. #include <iostream>
  4.  
  5. using namespace std;
  6.  
  7. int main([[maybe_unused]] int argc,
  8. [[maybe_unused]] const char * argv[])
  9. {
  10. vector<int> a{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
  11.  
  12. rotate(a.begin(),a.begin()+5,a.end());
  13.  
  14. for(int i: a) cout << i << " ";
  15.  
  16.  
  17. }
  18.  
Success #stdin #stdout 0s 4440KB
stdin
Standard input is empty
stdout
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5