package wvw;
import java.util.Arrays;
public class HelloWord {
public static void main(String[] args) {
int scores[] = {89,-23,64,91,119,52,73};
HelloWord A = new HelloWord();
System.out.println("成绩前三有:");
A.top3(scores);
/*Arrays.sort(scores);
for(int i = scores.length-1;i >=0;i--) {
System.out.print(scores[i] + " ");*/
}
public void top3(int []scores) {
Arrays.sort(scores);
int mun = 0;
for(int i = scores.length-1;i >=0;i++) {
if(0 <= scores[i] && scores[i] <= 100) {
System.out.print(scores + " ");
}else{
continue;
}
while(mun < 3) {
System.out.print(scores[i]);
mun++;
}
}
}
}
for循环里面的循环变量i应该是递减,你写成i++了
失误哈哈