1、random.nextInt(num)  

public static void main(String args[]) {
    Random  rdom = new Random();
    int max = 1314;
    int min = 520;
    for(int i = 0;i<2000;i++){
        int count = rdom.nextInt((max - min + 1)) + min;
        if(count==1313){
            System.out.println("1313=================>>>"+count);
        }else if (count==520){
            System.out.println("520=================>>>"+count);
        }else if(count<520 || count>1313){
            System.out.println("error=================>>>"+count);
        }else{
            System.out.println("success=================>>>"+count);
        }
    }
}

  

相关文章:

  • 2022-12-23
  • 2021-10-20
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-28
  • 2022-12-23
  • 2021-06-29
  • 2021-12-26
  • 2021-11-04
  • 2022-12-23
相关资源
相似解决方案