源自:7-1 编程练习
帮我看看是哪出错了?
import java.util.Arrays;
public class HelloWorld {
public static void main(String[] args) {
HelloWorld hello = new HelloWorld();
int[] scores = {89,-23,64,91,119,52,73};
int score = hello.arrange(scores);
System.out.println("考试成绩的前三名为:");
System.out.println(score);
}
public int arrange(int[] score){
Arrays.sort(score);
int j=0;
for(int i = (score.length-1); i>=0; i--){
if(score[i]<=100&&score[i]>=0){
j++;
return score[i];
}
if(j==3) break;
}
}
}
提问者:nullerror
2016-04-09 23:25