View Code of Problem 79

#include<stdio.h>

int main(){
	int n,i,j,k,temp;
	scanf("%d",&n);
	int a[100];
	for(i=0;i<n;i++)
		scanf("%d",&a[i]);
	scanf("%d",&i);
	for(j=0;j<i;j++){
		temp = a[n-1];
		for(k=n-1;k>=1;k--){	
			a[k] = a[k-1];	
		}	
		a[0] = temp;
	}
	for(j=0;j<n;j++){
		printf("%d",a[j]);
		if(j!=n-1)
			printf(" ");
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 79