Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int A[100],i,j,n,r,t;
- cin>>n>>r;
- for(i=0; i<n; i++)
- {
- cin>>A[i];
- }
- for(j=0; j<r; j++){
- t=A[0];
- for(i=1; i<n; i++)
- {
- A[i-1]=A[i];
- }
- A[n-1]=t;
- }
- for(i=0;i<n;i++){
- cout<<A[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment