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);
}
}
}
}
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交