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

  3. public class hihi {

  4.         public static void main(String[] args) {
  5.                 // TODO 自動產生的方法 Stub
  6.         Scanner c=new Scanner(System.in);
  7.         int a,b;
  8.         System.out.print("請輸入a: ");
  9.         a=Integer.parseInt(c.nextLine());
  10.         
  11.         System.out.print("請輸入b: ");
  12.         b=Integer.parseInt(c.nextLine());
  13.         
  14.         if(a>b)
  15.         {
  16.             System.out.print(a+">"+b) ;   
  17.         }
  18.         else if(a<b)
  19.         {
  20.                 System.out.print(a+"<"+b);
  21.         }
  22.         else
  23.         {
  24.                 System.out.print(a+"="+b);
  25.         }
  26.         }

  27. }
複製代碼

TOP

返回列表