/**//*有n个整数,使其前面各数顺序向后移m个位置,最 后m个数变成最前面的m个数*/ #include <stdio.h> #define N 8 void move(int x[], int n, int m) /**//*长度为n的数组,循环移动的变量为m*/ ...{ int i, *starta, *startb; int b[N]; /**//*b数组作为临时数组储存*/ starta = x; startb = b; for(i =0; i < n; i++) ...{ *(startb +(m+i)%n) =*(starta + i); /**//*循环移动*/ } for(i =0; i < n; i++) ...{ x[i] = b[i]; } } void main(void) ...{ int a[N]; int i, n, m; printf("input the array;"); for(i =0; i < N; i++) ...{ scanf("%d",&a[i]); } printf(" input the move data;"); scanf("%d",&m); move(a,N,m); printf("output the array:"); for(i =0; i < N; i++) ...{ printf("%2d",a[i]); } getch(); } 不知道写些什么,经过WIN-TC验证