纯随机数发生器--动手动脑
代码
import java.util.Random;
import java.util.Scanner;
public class TestSeed
{
public static void main(String[] args)
{
Random r = new Random(System.currentTimeMillis());
System.out.println("请输入要得到多少随机数");
int m;
Scanner in = new Scanner(System.in);
m = in.nextInt();
for(int i=0;i<m;i++)
System.out.println( r.nextInt());
}
}
效果图