- import java.io.Console;
- public class Ch06
- {
- public static void main(String args[])
- {
- Console c=System.console();
- System.out.print("輸入x:");
- int x=Integer.parseInt(c.readLine());
- System.out.print("輸入y:");
- int y=Integer.parseInt(c.readLine());
- if(x>y)
- System.out.println("x比y大");
- else if(x<y)
- System.out.println("x比y小");
- else
- System.out.println("兩數相等");
- }
- }
複製代碼 |