Java学习日记

时间:2022-05-27 21:32:59   收藏:0   阅读:8

Java随机数的运用:

首先导入包:

import java.math.*

然后运用函数Math.random()*fw

其中fw可以自己设定,比如Math.random()*100;

格式为

int x=(int)(Math.random()*fw);

仅举例,不一定是int x,数组也可以。

原文:https://www.cnblogs.com/chenyutong0321/p/15312575.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!