第一种for循环

int arr[] = { 1,2,3,4,5 ,6};
int start = 0;
int end = sizeof(arr) / sizeof(int) - 1;
int temp = 0;
for (int i = 0; i <= end/2; i++)
{
temp = arr[start + i];
arr[start + i] = arr[end - i];
arr[end - i] = temp;
}

第二种while循环

 int arr[6] = { 1,2,3,4,5,6};
int start = 0;
int end = sizeof(arr) / sizeof(int) - 1;
int temp = 0;
while (start < end)
{
temp = arr[start];
arr[start] = arr[end];
arr[end] = temp;
start++; end--;
}