• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

6:异或运算

异或运算:同为0,差为1。

或运算:同为1,差为0。

因此,XOR运算被记录为无进位加法。

int a=7;二进制00111

int b=1301101

a^b=?01010=10

自然:

1) 0^N=N

2) N^N=

3)满足交换定律和联想定律a^b=b^a;(a^b)^c=a^(b^c)

int a=12

int b=1;

只有A和B指向内存中两个不同的内存区域,才能这样玩。

a=a^b;

b=a^b;

a=a^b;

此时,a和b的值交换。

当I==j时,不。

1公共静态void swap(int[] arr,int i,int j) {

2 arr=arr^ arr[j];

3 arr[j]=arr^ arr[j];

4 arr=^ arr[j];

5 }

Link to comment
Share on other sites