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;  

} 

 

原文地址:https://www.cnblogs.com/qbmiller/p/3611416.html