本帖最後由 潘憶承 於 2019-8-2 12:00 編輯
- public class Ch09
- {
- public static void main(String args[])
- {
- Console c=System.console();
- int x,y;
- System.out.print("輸入x: ");
- x=Integer.parseInt(c.readLine());
- System.out.print("輸入y: ");
- y=Integer.parseInt(c.readLine());
- if(x<y)
- System.out.print("x>y");
- else if(x<y)
- System.out.print("x<y");
- else
- System.out.print("x=y");
- }
- }
複製代碼 |