我那個變量j一直報錯,這是為什么
?public void print(int[] scores){
? ? ? ? Arrays.sort(scores);
? ? ? ??
? ? ? ? for(int j=scores.length-1;j>=0;j--);{
? ? ? ? int score=scores[j];
? ? ? ? System.out.println("考試成績的前三名為:"+scores[j]);
? ? ? ? }
? ? }
?public void print(int[] scores){
? ? ? ? Arrays.sort(scores);
? ? ? ??
? ? ? ? for(int j=scores.length-1;j>=0;j--);{
? ? ? ? int score=scores[j];
? ? ? ? System.out.println("考試成績的前三名為:"+scores[j]);
? ? ? ? }
? ? }
2017-02-23
舉報
2022-03-27
感謝您的收聽 和--既可以出現在操作數的左邊,也可以出現在右邊,但結果是不同滴。請認真閱讀算術運算符中示例,已經講解很清楚
2017-02-23
程序沒有考慮不合法數據的情況,沒有考慮合法數據不足3個的情況,for循環后多了一個分號。
2017-02-23
沒調試 ,但是你for循環)后有個; ?明顯錯了!