Advertisement
Aleksandr_Grigoryev

11b

Nov 22nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {   const int n=5;
  5. int a[5]={1,4,2,6,3},i,y[n],z[n],j;
  6. for (i=0;i<n-1;i++)
  7. {
  8. y[i]=a[i+1];
  9. z[i+1]=a[i];
  10. }
  11. y[n-1]=a[0];
  12. z[0]=a[n-1];
  13. for(i=0;i<n;i++)
  14. cout<<y[i]<<' ';
  15. cout<<endl;
  16. for (i=0;i<n;i++)
  17. cout<<z[i]<<' ';
  18. system("pause");
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement