Skip to content

Commit 309ef9d

Browse files
committed
10-sec-comp: Add random-numbers challenge
1 parent 4437ab0 commit 309ef9d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import java.util.Random;
2+
3+
public class MyRandom {
4+
public static void main(String[] args) {
5+
Random number = new Random(123L);
6+
for (int i = 0; i < 20; i++) {
7+
// Generate another random integer in the range [0, 20].
8+
int n = number.nextInt(21);
9+
System.out.println(n);
10+
}
11+
}
12+
}

0 commit comments

Comments
 (0)