View Code of Problem 80

#include<bits/stdc++.h>
using namespace std;
int main() {
	int n, m, arr[10000],temp[10000],index;
	cin>>n;
	for(int i=0; i<n; i++) cin>>arr[i];
	cin>>m;
	index=m;
	for(int i=0; i<n-m; i++) temp[index++]=arr[i];
	index=0;
	for(int i=n-m; i<n; i++) temp[index++]=arr[i];
	for(int i=0; i<n; i++) cout<<temp[i]<<" ";
}

Double click to view unformatted code.


Back to problem 80