package main
import "fmt"
func main () {
a := 1
b := 2
a = a + b
b = a - b
a = a - b
fmt.Println(a,b)
c := 1
d := 2
c = c^d
d = c^d
c = c^d
fmt.Println(c,d)
}
2 1
2 1
异或:相同为0不相同为1
Example:
1:
10101
^ 00000
——————-
10101
a^0=a
2:
10101
^ 11100
——————-
01001
01001
^ 11100
——————-
10101