View Code of Problem 3929

#include<stdio.h>
int main(){
	int T;
	int j,i,n,sum,x;
	scanf("%d",&T);
	for(i=0;i<T;i++){
		scanf("%d",&n);
		for(j=0;j<n;j++){
			scanf("%d",&x);
			if(j==0){
				sum=x;
			}else{
				sum=sum^x;
			}
		}
		printf("%d\n",sum);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 3929