100以内生成3个随机数(Java)

package my;
import java.util.Random;
public class HolleWorld
{

public static void main(String[] args)
{
	// TODO Auto-generated method stub
	Random rand=new Random();
	for(int i=0;i<3;i++)
	{
		int s=rand.nextInt(100);
		System.out.println("生成随机数为 :"+s);
	}
}

}

猜你喜欢

转载自blog.csdn.net/weixin_43398418/article/details/87984320