返回列表 發帖
本帖最後由 張啟廣 於 2019-7-2 11:18 編輯
  1. import java.io.Console;
  2. public class Ch10
  3. {
  4.     public static void main(String args[])
  5.     {
  6.          Console c=System.console();
  7.          int x, y;
  8.          x=Integer.parseInt(c.readLine("請輸入x值: "));
  9.          y=Integer.parseInt(c.readLine("請輸入y值: "));
  10.          if(x>y)
  11.              System.out.println("x>y");
  12.          else if(x<y)
  13.              System.out.println("x<y");
  14.          else
  15.              System.out.println("x=y");
  16.     }
  17. }
複製代碼

TOP

返回列表