本帖最後由 張啟廣 於 2019-7-2 11:18 編輯
- import java.io.Console;
- public class Ch10
- {
- public static void main(String args[])
- {
- Console c=System.console();
- int x, y;
- x=Integer.parseInt(c.readLine("請輸入x值: "));
- y=Integer.parseInt(c.readLine("請輸入y值: "));
- if(x>y)
- System.out.println("x>y");
- else if(x<y)
- System.out.println("x<y");
- else
- System.out.println("x=y");
- }
- }
複製代碼 |