#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main() { int n,a[1000],m,i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); } scanf("%d",&m); for(i=n-m;i<n;i++){ printf("%d ",a[i]); } for(i=0;i<n-m-1;i++){ printf("%d ",a[i]); } printf("%d",a[n-m-1]); } |
Double click to view unformatted code.