专升本一题,读结果。

/

#include
#include

#define M 5
int main()
{
    int a[M]={1,2,3,4,5};
    int i,j,t;
    i=0;j=M-1;
    while(i     {
        t=*(a+i);
        *(a+i)=*(a+j);
        *(a+j)=t;
        i++;j--;
    }
    for(i=0;i         printf("%d\n",*(a+i));
    }
    
}
 

你可能感兴趣的:(算法,数据结构)