随机数

public class Test4 {

public static void main(String[] args) {
int x=(int) (Math.random()*100);//100以内的随机数
int y=(int) Math.random();//0或者1

System.out.println(x);
System.out.println(y);
}
}

 

posted @ 2017-05-31 18:07  Jachin  阅读(192)  评论(0编辑  收藏  举报