返回列表 發帖
  1. import java.io.Console;
  2. public class OAO
  3. {
  4.      public static void main(String args[])
  5.      {
  6.            int x,y;
  7.            Console c=System.console();
  8.            System.out.print("輸入X: ");
  9.            x=Integer.parseInt(c.readLine());
  10.            System.out.print("輸入Y: ");
  11.            y=Integer.parseInt(c.readLine());
  12.            if(x>y)
  13.            {
  14.                   System.out.print("X大於Y");
  15.            }
  16.             else if(x<y)
  17.            {
  18.                    System.out.print("X小於Y");
  19.            }
  20.               else
  21.            {
  22.                    System.out.print("X等於Y");
  23.            }

  24.      }
  25. }
複製代碼

TOP

返回列表