返回列表 發帖

while 迴圈 (一)

本帖最後由 tonyh 於 2014-11-15 17:47 編輯

利用 while 迴圈, 直列印出1~10.
  1. public class ch24
  2. {

  3.     public static void main(String args[])
  4.     {
  5.          int i=1;
  6.          while(i<=10)
  7.          {
  8.                System.out.println(i);
  9.                i++;
  10.          }
  11.     }
  12. }
複製代碼

返回列表