View Code of Problem 79

#include<stdio.h>
int main(){
	int a[100],b[100];
	int n,m,k=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	scanf("%d",&m);
	for(int j=n-m;j<n;j++){
		b[k]=a[j];
		k++;
	}
	for(int h=0;h<n-m;h++){
		b[k]=a[h];
		k++;
	}
	for(int l=0;l<n;l++){
		printf("%d ",b[l]);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 79