//Java實現
/*方法1*/
void swap(
int a,int b)
{
= a + b;
= a - b;
= a - b;
}
/*方法2--異或*/
void swap(
int a,int b)
{
= a^b;
= a^b;
= a^b;
}