返回列表 發帖
  1. import java.io.Console;
  2. public class ch18
  3. {
  4.     public static void main(String args[])
  5.     {
  6.           Console console=System.console();
  7.           int x, y;
  8.           System.out.print("初始值: ");
  9.           x=Integer.parseInt(console.readLine());
  10.           System.out.print("終止值: ");
  11.           y=Integer.parseInt(console.readLine());
  12.           for(int i=x; i<=y; i++)
  13.           {
  14.               System.out.print(i+" ");
  15.           }
  16.     }
  17. }
複製代碼

TOP

返回列表