23 lines
391 B
Java
23 lines
391 B
Java
package Course_Codes;
|
||
|
||
import java.util.Scanner;
|
||
|
||
//输入n和n-1个整数,输出只出现1次的个数
|
||
public class LQ_008 {
|
||
|
||
public static void main(String[] args) {
|
||
Scanner sc=new Scanner(System.in);
|
||
int n,ans=0;//读入几个数
|
||
|
||
while(sc.hasNext()) {
|
||
n=sc.nextInt();
|
||
ans=0;
|
||
for(int i=0;i<n;i++) {
|
||
ans=ans^sc.nextInt();
|
||
}
|
||
System.out.print(ans);
|
||
}
|
||
}
|
||
|
||
}
|