int main(){int n=5;int a[5]={2,4,5,7,8};int i;// 依次交换首尾元素,直到中间的数字for(i=0;i{ int t=a[i]; a[i]=a[n-1-i]; a[n-1-i]=t;}return 0;}