生成指定个数的随机数:
实验代码:
//信1605-3 赵春辉 2016346 指定个数随机数
import java.util.Scanner;
public class suijishu2
{
public static void main(String[] args)
{
System.out.println("please enter the count");
Scanner sc=new Scanner(System.in);
int count=sc.nextInt();
java.util.Random r=new java.util.Random();
for(int i=0;i<count;i++)
{
System.out.println(r.nextInt());
}
}
}