1 int ArrayShift(int a[], int n, int m) 2 { 3 int at[MAXN]; 4 5 m = m % n; 6 for (int i = 0; i < m; i++) 7 { 8 at[i] = a[n - m + i]; 9 } 10 for (int i = m; i < n; i++) 11 { 12 at[i] = a[i - m]; 13 } 14 for (int i = 0; i < n; i++) 15 { 16 a[i] = at[i]; 17 } 18 }