2016年5月11日

摘要: Random r=new Random(); int a []=new int[6]; for (int i=0;i<a.length;i++) { int n=r.nextInt(36); a[i]=n+1; for(int j=0;j<i;j++) { if(a[i]==a[j]) { i=i- 阅读全文
posted @ 2016-05-11 13:51 煜渝 阅读(534) 评论(0) 推荐(0) 编辑
摘要: 方法1(数据类型)(最小值+Math.random()*(最大值-最小值+1))例:(int)(1+Math.random()*(10-1+1))从1到10的int型随数 方法2获得随机数for (int i=0;i<30;i++){System.out.println((int)(1+Math.r 阅读全文
posted @ 2016-05-11 10:10 煜渝 阅读(2422) 评论(0) 推荐(0) 编辑

导航