var swap func(a, b *int) = func(a, b *int) {
*a ^= *b
*b ^= *a
*a ^= *b
}
a 0 0 1 1
b 0 1 0 1
a1=a^b 0 1 1 0
b1=b^(a^b) 0 0 1 1
a2=a1^(b1^(a^b)) 0 1 0 1
a^b=b^a
b^(a^b)=b^a^b=b^b^a=a
(a^b)^[b^(a^b)^(b)]=b
满足交换律
标签:,交换律,int,a1,a2,b1,func
来源: https://www.cnblogs.com/rsapaper/p/14602627.html