用C++写的。
void reverse(int a[], int n) { int i = 0, j = n - 1; while (i < j) { int tmp = a[j]; a[j] = a[i]; a[i] = tmp; i++; j--; }}