import java.util.Arrays;
public class ImoocJava {
public static void main(String[] args) {
int [] scores = {89,-23,64,91,119,52,73};
System.out.println("考试成绩的前三名为:");
int [] top = getTop3(scores);
System.out.println(Arrays.toString(top));
}
public static int [] getTop3(int [] scores){
Arrays.sort(scores);
int count = 0;
int [] cj = new int [3];
for(int i = scores.length-1;i>=0;i--){
if(scores[i]<0||scores[i]>100){
continue;
}
count ++;
for (int j = 0;j<=2;j++){
cj[j] = scores[i];
}
if (count>3){
break;
}
}
return cj;
}
}