返回列表 發帖
  1. import java.util.Scanner;
  2. public class test {

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub
  5.                 Scanner a=new Scanner(System.in);
  6.                 int x,y;
  7.                 System.out.print("請輸入x:");
  8.                 x = Integer.parseInt(a.nextLine());
  9.                 System.out.print("請輸入y:");
  10.                 y = Integer.parseInt(a.nextLine());
  11.                 if(x>y)
  12.                         System.out.println(x+">"+y);
  13.                 else if(x<y)
  14.                         System.out.println(x+"<"+y);
  15.                 else
  16.                         System.out.println(x+"="+y);
  17.         }
  18. }
複製代碼

TOP

返回列表