Board logo

標題: for 迴圈 (一) [打印本頁]

作者: 陳弘修    時間: 2020-10-31 10:05     標題: for 迴圈 (一)

在螢幕上顯示數字從1到10, 直向排列.
作者: 龔品誠    時間: 2020-10-31 10:56

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

作者: 林羿丞    時間: 2020-10-31 11:00

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

作者: 李穎俊    時間: 2020-10-31 11:00

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

作者: 陳莉榛    時間: 2020-10-31 11:37

  1. public class Ch666
  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. }
複製代碼

作者: 朱閎聿    時間: 2020-11-7 09:51

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

作者: 王銘鴻    時間: 2020-11-7 09:54

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

作者: 張淯祺    時間: 2020-11-7 09:56

  1. import java.io.Console;
  2. public class a02
  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. }
複製代碼

作者: 黃柏智    時間: 2020-11-7 09:59

import java.io.Console;
public class a02
{
public static void main(String args[])
{
  Console c=System.console();
  for(int i=1;i<=10;i++)
  System.out.println(i);
}
}




歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://seed.istak.org.tw/) Powered by Discuz! 7.2