=口=我的資料庫,哀慘淡的5分。

ˊˇˋ只好期待期末考了,嗯。

 


 

結果圖:

Random  

 

程式碼:

 

public class RandomInt{
     public static void main(String args[]){
           int iRandom=(int)(Math.random()*51+150);

          //int 變數名稱=(強迫轉成int)(Math.random()*集合數量+150)

         //集合數量裡數字是由0開始算,所以如果集合數量是3={0,1,2}

        //"+150"代表從150(0+150)開始到200(50+150)

          System.out.print(iRandom); 

     }
}

arrow
arrow
    全站熱搜

    o迷苓o 發表在 痞客邦 留言(0) 人氣()