帮忙看看对数值排序然后打印出前三的方法,这么写为什么不对?
public void work(int[] scores){
int count=0;
Arrays.sort(scores);
for(int i=0;i<scores.length-1;i++){
if(scores[scores.length-i]>100||scores[scores.length-i]<0){
continue;
}
count=count+1;
System.out.println(scores[i]);
if(count>2){
break;
}
}
}