这样写除了让代码更多了是不是没有任何意义?
package imooc;
import java.util.Arrays;
public class HelloWorld {
public static void main(String[] args) {
int[]scores={89,465,89,1561,16,48,684,65,548,4};
System.out.println("前三甲:");
HelloWorld best=new HelloWorld();
best.fuck(scores);
}
public void fuck(int[]scores){
int j=0;
int[]best1=new int[scores.length];
for(int i=0;i<scores.length;i++){
if(scores[i]>=0&&scores[i]<=100){
best1[j]=scores[i];
j++;
}
}
Arrays.sort(best1);
for(int k=best1.length-1;k>=best1.length-3;k--){
System.out.println(best1[k]);
}
}
}