import Foundation
//方法一
var a=1,b=2;
var c=0;
c=a;
a=b;
b=c;
print(a,b);
//方法二
var x = 5,y = 10
//轉(zhuǎn)換成二進(jìn)制后計(jì)算
//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
//轉(zhuǎn)換成二進(jìn)制后計(jì)算
//5:0101
//10:1010
x=x^y//1111
y=x^y//0101
x=x^y//1010
print(x,y)