int a = 5; // a0 = 5
int b = 8; // b0 = 8
a = a^b; // a = a0^b0
b = a^b; // b = a0^b0^b0 = a0
a = a^b; // a = a0^b0^a0 = b0
/********************************
and similar solution
********************************/
int a = 5;
int b = 8;
a = a+b;
b = a-b;
a = a-b;
/********************************
and similar solution
********************************/
int a = 5;
int b = 8;
a = a*b;
b = a/b;
a = a/b;
C/C++ Quiz: Exchange int a and int b without int temp
最新推荐文章于 2024-07-11 17:58:15 发布