我那個變量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
感謝您的收聽 和--既可以出現(xiàn)在操作數(shù)的左邊,也可以出現(xiàn)在右邊,但結(jié)果是不同滴。請認真閱讀算術(shù)運算符中示例,已經(jīng)講解很清楚
2017-02-23
程序沒有考慮不合法數(shù)據(jù)的情況,沒有考慮合法數(shù)據(jù)不足3個的情況,for循環(huán)后多了一個分號。
2017-02-23
沒調(diào)試 ,但是你for循環(huán))后有個; ?明顯錯了!