這樣為啥是失敗的?哪里出錯(cuò)了額?
public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
? ? ? ? Test t=new Test();
? ? ? ? int[] scores={89,-23,64,91,119,52,73};
? ? ? ? t.rank(scores);
? ? ? ??
}
?
public void rank(int[] score){
? ? ? ? int[] score2= {};
? ? ? ? Arrays.sort(score);
? ? ? ? for(int i=0;i < score.length;i++){
? ? ? ? ? ? if(score[i]>100 || score[i]<0){
? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? }
? ? ? ? ? ? score2[i]=score[i];
? ? ? ? }
? ? ? ? for(int j=score2.length-1;j<score2.length-4;j--){
? ? ? ? System.out.println(score2[j]);
? ? ? ? }}}
2019-01-29
吶,現(xiàn)在可以運(yùn)行了,不知道什么功能,所以我就改成了能運(yùn)行的樣子