题目如下:
import java.util.Scanner;
public class Demo_找出落单的那个数 {
/**
* @param args
*/
public static void main(String[] args) {
int a[] = new int[5];
Scanner sc = new Scanner(System.in);
for (int i = 0; i < a.length; i++) {
a[i]=sc.nextInt();
}
//辅助数组来做,如果只出现一次,就是1喽
int helper[] = new int[5];
for (int i = 0; i < helper.length; i++) {
helper[a[i]]++;
}
for (int i = 0; i < helper.length; i++) {
if (helper[i]==1) {
System.out.println(i);
}
}
}
}