/*
* 需求1:产生10个 [0,1) 之间的随机数
* 2: 产生10个 [0,10)之间的随机整数
* 3.产生10个 [10,20)之间的随机整数
* 4.产生 10个 [10,20] 之间的随机整数 等价于 [10,21)
* */
public class TestMath {
public static void main(String[] args) {
//1:产生10个 [0,1) 之间的随机数
for(int i=0;i<10;i++){
//System.out.println(Math.random()+"\t");
}
//2:产生10个 [0,10)之间的随机整数
for(int i=0;i<10;i++){
int a=(int) (Math.random()*10);
//System.out.print(a+"\t");
}
//3.产生10个 [10,20)之间的随机整数
for(int i=0;i<10;i++){
int a=(int) (Math.random()*11+9);
//System.out.print(a+"\t");
}
//4.产生 10个 [10,20] 之间的随机整数 等价于 [10,21)
for(int i=0;i<10;i++){
int a=(int) (Math.random()*11+10);
System.out.print(a+"\t");
}
}
}