fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int n;
  7. cin >> n;
  8. vector<int> ar(n);
  9. for(int ar_i = 0; ar_i < n; ar_i++){
  10. cin >> ar[ar_i];}
  11.  
  12.  
  13. int temp,count=0;
  14. int k=1;
  15. for (int i=1;i<n;i++)
  16. { for(int j=0;j<(n-1);j++)
  17. { if(j<j+1)
  18. {temp=ar[j+1];
  19. ar[j+1]=ar[j];
  20. ar[j]=temp;}}}
  21. for(int k=0;k<n;k++)
  22. cout<<ar[k];
  23. }
  24.  
Success #stdin #stdout 0s 16064KB
stdin
7
4
5
6
4
5
4
4
stdout
4456454