//介紹Random類,有兩種:java.util.Random或者是java.lang.Math類中的random()方法
import java.util.Random;
public class RandomTest
{
public static void main(String[] args)
{ //第一種random,得出的範圍是從0開始到數字的結尾,但不包括最後一個數
Random random = new Random();
for(int i = 0; i < 50; i++)
{
//System.out.println(random.nextInt(41) + 10);
//第二種random,得出的範圍是0.0到1.0(不包括1.0)
double result = Math.random();
result *= 41;
int result2 = (int)result;
result2 += 10;
System.out.println(result2);
}
}
}