
public class shuzu {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
System.out.println("请输入想生成的随机数的个数");
int i=input.nextInt();
int intk[]=new int[i];//声明一维有i个数的数组
/*随机数生成
* Math.random()*30生成从1-30的随机数*/
for(int k=0;k<i;k++){
intk[k]=(int)(200+Math.random()*30);
System.out.print(intk[k]+"\t");
}
}
}



by: 发表于:2017-07-07 15:46:15 顶(0) | 踩(0) 回复
??
回复评论