public static int singleNumber(int []a
){
int num
=0;
for (int i
=0;i
<a
.length
;i
++){
num
=num
^a
[i
];
}
return num
;
}
public static void main(String
[] args
) {
int []a
={1,2,1,3,4,4,3,5,5,2,8};
int s
=singleNumber(a
);
System
.out
.println(s
);
}
转载请注明原文地址:https://tech.qufami.com/read-19027.html