- import java.io.Console;
- public class Ch011
- {
- public static void main(String args[])
- {
- Console c=System.console();
- int x, y;
- System.out.println("Please enter x value: ");
- x=Integer.parseInt(c.readLine());
- System.out.println("Please enter y value: ");
- 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("x=y");
- }
- }
- }
複製代碼 |