摘要: package Test;import demo.Student;public class TestStudent { public static void main(String[] args) { Student str1=new Student("李四","31岁"); S... 阅读全文
posted @ 2015-06-04 12:08 wenyi1993 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 方法1:int a[100]={0};int i, m;for(i=1; i=1; --i) swap(a[i], a[rand()%i]);上面这段代码只需要遍历一次就可以产生这100个不重复的随机数,它是如何做到的呢?首先第二行按顺序用0到99填满整个数组;第三行,是随机产生从0到m-2个数组下... 阅读全文
posted @ 2015-06-04 11:22 wenyi1993 阅读(224) 评论(0) 推荐(0) 编辑