import Foundation
//方法一
var a=1,b=2;
var c=0;
c=a;
a=b;
b=c;
print(a,b);
//方法二
var x = 5,y = 10
//转换成二进制后计算
//5:0101
//10:1010
x=x^y//1111
y=x^y//0101
x=x^y//1010
print(x,y)
import Foundation
//方法一
var a=1,b=2;
var c=0;
c=a;
a=b;
b=c;
print(a,b);
//方法二
var x = 5,y = 10
//转换成二进制后计算
//5:0101
//10:1010
x=x^y//1111
y=x^y//0101
x=x^y//1010
print(x,y)