//(Math.Random()n)返回>=0并且小于n的随机数 //取n-m范围的随机数,m+(Math.Random()(m-n)) for (int i=0;i<=10;i++){ int s = (int) 2+(int)(Math.random() * (10 - 2)); if(s%2==0){ System.out.println(0) ; }else { System.out.println();} }