java随机数组

import java.util.Random;


public class Ccore {

    
    public static void main(String[] args) {
        for(int i=1;i<=9;i++){
            for(int j=1;j<=i;j++){
                System.out.print(+i+"*"+j+"="+i*+j+"	");
            }
            System.out.println();
        }
        Random x=new Random();//(一)
        int y=x.nextInt(10);
        System.out.println("输入的随机数为:"+y);//灵活。因为已经赋值给y了
        
          int a=(int)(Math.random()*10+1);//(二)
          System.out.println(a);
         
            
        

    }

}

  

原文地址:https://www.cnblogs.com/langlove/p/3383243.html