View Code of Problem 79

#include <iostream>
#include <algorithm>
using namespace std; 
int main(){
	int n;
	cin>>n;
	int a[n+1]={0};
	for(int i=1;i<=n;i++)
		cin>>a[i];
	int m;
	cin>>m;
	for(int i=n-m+1;i<=n;i++)
	cout<<a[i]<<" ";
	for(int i=1;i<=n-m;i++)
	cout<<a[i]<<" "; 
}

Double click to view unformatted code.


Back to problem 79