import java.util.Scanner;

public class shiyan
{
 /**
  * 
  * @param args
  */
	public static void main(String args[])
	{
		//生成10以内的随机数
		double d = Math.random();
		int x =(int)(d*10);
		System.out.println(x);
		//生成到100的随机数
		double d = Math.random();
		int x =(int)(d*101);
		System.out.println(x);
	}
}

 

相关文章:

  • 2021-06-04
  • 2021-07-30
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
猜你喜欢
  • 2022-03-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2021-10-02
  • 2021-05-25
  • 2022-12-23
相关资源
相似解决方案