1060(13)
阿新 • • 發佈:2018-12-19
package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] s=new int[n]; int i,e,count; for (i=0;i<n;i++){ s[i]=sc.nextInt(); } //i是距離 for(e=1;e<=n;e++){ count=0; for (i=0;i<n;i++){ if (s[i]>e){ count++; } } if (count==e){ System.out.println(count); } } } }