public class m8_1 {
public static void main (String[] args) {
System.out.println("前三名的成绩依次是:");
int scores [] ={89,-23,64,91,119,52,73};
m8_1 hello =new m8_1();
hello.mY(scores);
}
public void mY (int scores[]){
Arrays.sort(scores);
int count = 1;
for(int i=scores.length; i>=0 ; i--){
if(scores[i] > 0&&scores[i] < 100){
System.out.println(scores[i]);
count++;
if(count==3){
break;
}
else{
continue;
}
}
else{
continue;
}
}
}
}
慕粉4065503
望远
相关分类