jieless
//生成6位随机数字
   System.out.println((int)((Math.random()*9+1)*100000));
//生成5位随机数字
   System.out.println((int)((Math.random()*9+1)*10000));
//生成4位随机数字
   System.out.println((int)((Math.random()*9+1)*1000));
//生成3位随机数字
   System.out.println((int)((Math.random()*9+1)*100));
//生成2位随机数字
   System.out.println((int)((Math.random()*9+1)*10));
//生成1位随机数字
   System.out.println((int)((Math.random()*9+1)));

  

分类:

技术点:

相关文章:

  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-09-02
  • 2021-11-18
  • 2021-12-18
猜你喜欢
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
相关资源
相似解决方案