這樣為什么不可以
public class HelloWorld {
? ? public static void main(String[] args) {
// 定義一個數(shù)組,保存五名學(xué)生的成績
int[] scores = { 78, 93, 97, 84, 63 };
// 輸出數(shù)組中的第二個成績
? ? ? ? int s= scores[1];
System.out.println("數(shù)組中的第2個成績?yōu)椋?+s);
}
}
public class HelloWorld {
? ? public static void main(String[] args) {
// 定義一個數(shù)組,保存五名學(xué)生的成績
int[] scores = { 78, 93, 97, 84, 63 };
// 輸出數(shù)組中的第二個成績
? ? ? ? int s= scores[1];
System.out.println("數(shù)組中的第2個成績?yōu)椋?+s);
}
}
2015-05-16
舉報
2015-10-19
”請檢查代碼中是否匹配:System.out.println("數(shù)組中的第2個成績?yōu)椋? + scores[1] );,再試試!“這是我試過后的提示,這說明是因為系統(tǒng)只是匹配這條語句作為正確與否的標準;所以你是對的;
2015-09-11
在編程軟件上是對的
2015-05-16
這個方法可以的,要是自己寫,然后在自己電腦上肯定能運行,但是你現(xiàn)在是在做作業(yè),老師給的標準代碼不是這個,所以在提交時過不了,
不是這個方法錯誤,而是老師給的標準答案不是這個,
老師也不能把所有可能出現(xiàn)的正確代碼全設(shè)為正確答案,以為他也不一定知道會出現(xiàn)多少種方法。