C++数组反转源码
把开发过程比较重要的一些内容段收藏起来,下边内容内容是关于C++数组反转的内容。
#include <stdio.h>{}void reverse(int a[],int n){ static int c = 0; if(c<n/2) { xchg(&a[c],&a[n-c-1]); ++c; reverse(a,n); }}void show(int a[],int n){ int i; for(i=0;i<n;i++) { }}int main(){ int a[]={1,2,4,5,3,6}; reverse(a,6); show(a,6); return 0;}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。