lq1.3 How to find the number placed in the array

Insert picture description here

//a^a=0;a^0=a

#include <stdio.h>

int main()
{
    
    
	int a[11]={
    
    0,0,1,1,2,2,3,3,4,4,5};
	int b=a[0];
	//直接把数组中的元素异或一遍 
	for(int i=1;i<11;i++)
	{
    
    
		b=b^a[i];
	}

	printf("%d",b); 
}

Guess you like

Origin blog.csdn.net/June159/article/details/108371553