返回列表 發帖
  1. import java.io.Console;
  2. public class Ch09
  3. {
  4.     public static void main(String args[])
  5.     {
  6.          Console c=System.console();
  7.          int x=Integer.parseInt(c.readLine("請輸入x的值"));
  8.          int y=Integer.parseInt(c.readLine("請輸入y的值"));
  9.          if(x>y)
  10.              System.out.println("x大於y");
  11.          else if(x<y)
  12.              System.out.println("x小於y");
  13.          else
  14.              System.out.println("x等於y");
  15.     }
  16. }
複製代碼

TOP

返回列表