swap交换2变量

#define swap(x,y) {(x)=(x)+(y); (y)=(x)-(y); (x)=(x)-(y);}

 

void swap(int i, int offset){  

    int temp;  

    temp = a[offset];  

    a[offset] = a[i];  

    a[i] = temp;  

} 

 

 

posted @ 2014-03-19 14:48  義丨往昔灬miller  阅读(167)  评论(0编辑  收藏  举报