錯(cuò)誤在哪??求解、
import java.uilt.Arrays;
public class HelloWorld {
? ?public static void main(String[] args) {
? ? ?int[]scores={89,-23,64,91,119,52,73}; ??
? ? ?System.out.println("考試成績的前三名:"); ??
? ? ? ? Helloworld hello=new HelloWorld();
? ? ? ? hello.showTop3(scores); ? ?
? ? }
? ? public void showTop3(int[] scores){
? ? ? ? Arrays.sort(scores);
? ? ? ? int num=0;
? ? ? ? for(int i=scores.length-1;i>=0;i--){
? ? ? ? ? ? if(scores[i]<0||scores[i]>100){
? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? }
? ? ? ? ? ? num++;
? ? ? ? ? ? if(num>3){
? ? ? ? ? ? ? ? break;
? ? ? ? ? ? }
? ? ? ? ? ? System.out.println(scores[i]);
? ? ? ? }
? ? }
}
2015-06-17
前后大小寫不一致
2015-06-08
import java.uilt.Arrays;
Helloworld hello=new HelloWorld();
這兩句有問題 你在看下吧
2015-06-08
?Helloworld hello=new HelloWorld(); 這句寫錯(cuò)了,不說原因,自己研究