Math.random()를 이용해서 1부터 47사이의 임의의 int 형 정수를 6개 출력 하는 프로그램을 작성하시오.
for (int i=0; i<6; i++) {
System.out.println((int)(Math.random() *47) + 1);
}
43
28
31
21
33
1
double java.lang.Math.random()
Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returned values are chosen pseudorandomly with (approximately) uniform distribution from that range.