返回列表 發帖
  1. import java.util.Scanner;


  2. public class Ac {

  3.         public static void main(String[] args) {
  4.                 // TODO 自動產生的方法 Stub
  5.                 Scanner c = new Scanner(System.in);
  6.                 int a,s;
  7.                 System.out.print("請輸入第一個數:");
  8.                 a = c.nextInt();
  9.                 System.out.print("請輸入第二個數:");
  10.                 s = c.nextInt();
  11.                 if(a>s)
  12.                 {
  13.                         System.out.print(a+">"+s);
  14.                 }else if(a<s)
  15.                 {
  16.                         System.out.print(a+"<"+s);
  17.                 }else
  18.                 {
  19.                         System.out.print(a+"="+s);
  20.                 }
  21.         }

  22. }
複製代碼

TOP

返回列表