基礎程式設計(Java)· CH7
增強 for for (int x : a) 求和:看索引指標移動、total 怎麼累加。
for (int x : a)
total
真 Java,瀏覽器內編譯執行。
瀏覽器無鍵盤輸入,範例用初始化清單給死資料(不用 Scanner)。
Scanner
輸出