Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void shift(int n, int x[100]) {
- int i, a=x[0];
- for (i=1; i<n; i++)
- x[i-1] = x[i];
- x[n-1] = a;
- }
- int main() {
- int n, x[100];
- cin>>n;
- for (int i=0; i<n; i++)
- cin>>x[i];
- for (i=0; i<n; i++)
- shift(n-i, x);
- for (i=0; i<n; i++)
- cout<<x[i]<< " ";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement