#include <stdio.h>
#define MAX_SIZE 20 /* 最大数组个数 */
void TransposeArray(int *arr,int size);
int main()
{
int size = 0;
int orien_arr[MAX_SIZE] = {0,};
printf("Input N: \n");
scanf("%d",&size);
printf("The Orign Array is :\n");
for (int i = 0; i < size; i++)
{
scanf("%d",orien_arr+i);
}
TransposeArray(orien_arr,size);
printf("The Transposed Array is :\n");
for (int i = 0; i < size; i++)
{
printf("%d\t",*(orien_arr+i));
}
printf("\n");
return 0;
}
/*转换函数*/
void TransposeArray(int *arr,int size)
{
for (int i = 0; i <= (size-1)/2; i++)
{
int tmp = *(arr+i);
*(arr+i) = *(arr+size-i-1);
*(arr+size-i-1) = tmp;
}
}