import java.util.Arrays;
public class Score {
    public static void main(String[] args) {
        int[] scores = {89, 23, 64, 91, 119, 52, 73};
        Arrays.sort(scores);
        Score hello = new Score();
        hello.top(scores);
    }
    public void top(int[] scores) {
        System.out.print("考试成绩的前三名;");
        int num = 0;
        for (int i = scores.length - 1; i > 0; i--) {
            if (scores[i] > 0 && scores[i] < 100) {
                num++;
                if (num > 3) {
                    break;
                }
                System.out.print(scores[i]);
            }
        }
    }
}
修订版:
import java.util.Arrays;
public class Score {
    public static void main(String[] args) {
        int[] scores = {89, 23, 64, 91, 119, 52, 73};
        Arrays.sort(scores);
        Score hello = new Score();
        hello.top(scores);
    }
    public void top(int[] scores) {
        System.out.print("考试成绩的前三名;");
        int num = 0;
        for (int i = scores.length - 1; i > 0; i--) {
            if (scores[i] > 0 && scores[i] < 100) {
                num++;
                if (num > 3) {
                    break;
                }
                System.out.print(scores[i]);
            }
        }
    }
}