一个数组中的元素头尾两端依次对调

void reverse_array(int a[],int cnt){
    int first,last;


    for (first = 0,last = cnt - 1;first < last;first ++,last –){
        inplace_swap(&a[first],&a[last]);
    }
}
posted @ 2012-11-07 09:28  flowjacky  阅读(977)  评论(1编辑  收藏  举报