public class demo {
public static void main(String[] args) {
int[] scores={89,-23,64,91,119,52,73};
demo hello=new demo();
hello.sort(scores);
System.out.println("考试成绩前三名为:"+'\n'+scores[scores.length-1]+'\n'+scores[scores.length-2]+'\n'+scores[scores.length-3]);
}
public void sort(int[] scores){
for(int i=0;i<scores.length;i++){
if(scores[i]<0||scores[i]>100)
scores.equals(scores[i]);
}
Arrays.sort(scores);
}
}
qq__9979
相关分类