import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// 100个太多了,你要改成100就把下面的5改成100
int[] a = new int[5];
int count = 0;
for(int i = 0; i < a.length; i++ ){
System.out.print("输入第[ " + ( i + 1) + " ]个数: ");
a[i] = sc.nextInt();
}
System.out.println("再输入一个数: ");
int temp = sc.nextInt();
for(int i = 0; i < a.length; i++){
if(temp == a[i]){
count++;
}
}
System.out.println(temp + "出现 " + count + "次.");
}
}
100个太多了,你要改成100就把那个5改成100