返回列表 發帖
  1. public class Ch01 {

  2.         public static void main(String[] args) {
  3.                 // TODO 自動產生的方法 Stub
  4.                 for(int i=1;i<=30;i++){
  5.                         int r;
  6.                         r=(int)(Math.random()*10+123);
  7.                         System.out.println(r);
  8.                 }       
  9.         }
  10. }
複製代碼

TOP

本帖最後由 吳溦珊 於 2023-1-6 20:55 編輯
  1. public class Ch01 {

  2.         public static void main(String[] args) {
  3.                 // TODO 自動產生的方法 Stub
  4.                 int i=1;
  5.                 while(i<=30){
  6.                         System.out.println((int)(Math.random()*10+123));
  7.                         i++;
  8.                 }       
  9.         }
  10. }
複製代碼

TOP

返回列表