C++取反交換兩個數的值

大囚長發表於2018-12-19
	int a = 1;
	int b = 2;
	cout << "a: "<< a << endl;
	cout << "b: "<< b << endl;
	a = a ^ b;
	b = a ^ b;
	a = a ^ b;
	cout << "a: " << a << endl;
	cout << "b: " << b << endl;

相關文章