# 010public class Foreach { foreach(陣列元素型別、變數名稱:陣列變數名稱){....} public static void main(String[] args) { // 1 - 6 => 各出現次數 int[] point = new int[6]; // 0 - 5 for (int i=0; i<100; i++){ point[(int)(Math.random()*6)]++; } for (int value : point){ System.out.println(value); }
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up