这样为什么不行?谢谢!
import java.util.Arrays;
public class Kevin {
public int[] order(int[] scores) {
Arrays.sort(scores);
int num = 0;
for(int i = (scores.length - 1); i>=0; i++) {
if(scores[i] > 100 || scores[i] < 0) {
continue;
}
num++;
if(num>3) {
break;
}
}
return scores;
}
public static void main(String []args) {
Kevin hbb = new Kevin();
System.out.println("考试成绩的前三名:");
int[] scores = {89 , -23 , 64 , 91 , 119 , 52 , 73};
System.out.println(hbb.order(scores));
}
}