8つの箱にランダムに値を入れます
RandomInt.java
var r = new Random();
int[] array = new int[8];
for(int i = 0; i < array.length; i++) {
array[i] = r.nextInt(30);
}
実行(例)
28
10
9
2
0
23
21
26
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
8つの箱にランダムに値を入れます
var r = new Random();
int[] array = new int[8];
for(int i = 0; i < array.length; i++) {
array[i] = r.nextInt(30);
}
実行(例)
28
10
9
2
0
23
21
26
Register as a new user and use Qiita more conveniently
Go to list of users who liked