View Code of Problem 79

#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
cin>>n;
int a[2*n];

for(int i=0;i<n;i++)
    cin>>a[i];
    cin>>m;

for(int i=0;i<n;i++){
    a[n+i]=a[i];
}
for(int i=n-m;i<2*n-m;i++)
    cout<<a[i]<<" ";
return 0;
}

Double click to view unformatted code.


Back to problem 79