返回列表 發帖
  1. import java.io.Console;
  2. public class CH08

  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.         {
  12.             System.out.println("x>y");
  13.         }
  14.         else if(x<y)
  15.         {
  16.             System.out.println("x<y");
  17.         }
  18.         else
  19.         {
  20.             System.out.println("x=y");
  21.         }


  22.     }
  23. }
複製代碼

TOP

返回列表