View Code of Problem 79

#include<stdio.h>
int main(){
	int n,m;
	int a[20];
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
		 while(i!=n-m-1){
		   a[i+m] = a[i]; 			
	}
	scanf("%d",&m);

	a[0] = a[n-2];
	a[1] = a[n-1];
	for(int i=0;i<n;i++){
		printf("%d",a[i]);
	}

	return 0;
} 
/*
Main.c: In function 'main':
Main.c:20:1: error: expected declaration or statement at end of input
 }
 ^
*/

Double click to view unformatted code.


Back to problem 79