返回列表 發帖
  1. import java.io.Console;
  2. public class Ch06
  3. {
  4.   public static void main(String args[])
  5.   {
  6.       int x,y;
  7.       Console c=System.console();
  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.       System.out.println("兩數相等!");




  20.       }
  21. }
複製代碼

TOP

返回列表