最后一道我明明是按照參考寫的為什么一直報錯
import java.util.Arrays;
public class HelloWorld {
? ? //完成 main 方法
? ? public static void main(String[] args) {
? ? ? ? int[] scores ={89,-23,64,91,119,52,73};
? ? ? ? System.out.println("考試成績的前三名為");
? ? ? ? HelleWorld 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(secores[i]<0 || scores[i]>100){
? ? ? ? ? ? ? ? continue;
? ? ? ? ? ? }?
? ? ? ? ? ? num++;
? ? ? ? ? ? if(num >3)
? ? ? ? ? ? break;
? ? ? ? }
? ? ? ? System.out.println(score[i]);
? ? ? ??
? ? }
? ??
2018-04-18
認真看報錯信息可以少浪費一些時間 報錯都是符號問題,并且有具體的報錯位置
2018-04-17
2018-04-17
報錯為:
運行失敗