#include<stdio.h>
#include<stdlib.h>
int main()
{
int i = 0;
int num= 0;
int arr[7];
for (; i < 7; i++)
{
scanf("%d", &arr[i]);
}
num = arr[0];
for (i = 1; i < 7; i++)
{
num = num^arr[i];//a异或b之后再异或b,结果是a等同于(a^b)^b=a,同样,(a^b)^a=b,因为a^a(自身异或自身)就等于0000....0000,再异或别的数,就只剩下再次异或的数了.
}
printf("%d\n", num);
system("pause");
return 0;
}
转载于:https://blog.51cto.com/10740329/1705778