返回列表 發帖

for 迴圈 (一)

在螢幕上顯示數字從1到10, 直向排列.

  1. import java.io.Console;
  2. public class Ch08
  3. {
  4.     public static void main(String args[])
  5.     {
  6.         for(int i=1; i<=10; i++)
  7.             System.out.println(i);
  8.     }
  9. }
複製代碼
Huang chenhao

TOP

  1. import java.io.Console;
  2. public class Ch01
  3. {
  4.     public static void main(String args[])
  5.     {
  6.         for(int i=1;i<=10;i++)
  7.         {
  8.             System.out.println(i);
  9.         }
  10.     }
  11. }
複製代碼

TOP

  1. import java.io.Console;
  2. public class Ch09
  3. {
  4.     public static void main(String args[])
  5.     {
  6.         for(int i=1; i<=10; i++)
  7.             System.out.println(i);
  8.     }
  9. }
複製代碼

TOP

  1. import java.io.Console;
  2. public class Ch06
  3. {
  4.   public static void main(String args[])
  5.   {
  6.      for(int i=1 i<=10; i++)
  7.      {
  8.       System.out.println(i);
  9.      }

  10.   }
  11. }
複製代碼

TOP

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

TOP

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

TOP

  1. public class Ch08
  2. {
  3.     public static void main(String args[])
  4.     {

  5.         for(int i=1;i<=10;i++){
  6.             System.out.println(i);
  7.         }
  8.     }
  9. }
複製代碼
hahahahahahahaha

TOP

  1. import java.io.Console;
  2. public class Ch08
  3. {
  4.     public static void main(String args[])
  5.     {
  6.         for(int i=1; i<=10; i++)
  7.         {
  8.             System.out.println(i);
  9.         }
  10.     }
  11. }
複製代碼

TOP

  1. import java.io.Console;
  2. public class Ch10
  3. {
  4.     public static void main(String args[])
  5.     {
  6.          for(int i=1; i<=10; i++)
  7.          {
  8.             System.out.println(i);
  9.          }
  10.     }
  11. }
複製代碼

TOP

  1. import java.io.Console;
  2. public class Ch09
  3. {
  4.     public static void main(string args[])
  5.     {
  6.         for(i=1; i<=10; i+=2)
  7.         {
  8.             System.out.printIn(i);
  9.         }
  10.     }
  11. }
複製代碼
李宇澤Oscar

TOP

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

TOP

  1. import java.io.Console;
  2. public class Ch09
  3. {
  4.     public static void main(String args[])
  5.     {
  6.         for(int i=1; i<=10; i++)
  7.             System.out.println(i);
  8.     }
  9. }
複製代碼

TOP

返回列表