返回列表 發帖
  1. import java.util.Scanner;       
  2. public class JPA02 {
  3.    static Scanner keyboard = new Scanner(System.in);
  4.    public static void main(String[] args)
  5.    {
  6.     test();
  7.     test();
  8.    }
  9.    public static void test()
  10.    {
  11.         int a,b;
  12.     System.out.println("Input :");
  13.     a=keyboard.nextInt();
  14.     b=keyboard.nextInt();
  15.     if(a>b)
  16.     {
  17.       System.out.println(a+" is larger than "+b);
  18.     }
  19.     else if(a<b)
  20.     {
  21.       System.out.println(b+" is larger than "+a);
  22.     }
  23.     else if(a==b)
  24.     {
  25.       System.out.println(a+"equal"+b);
  26.     }
  27.    }
  28.   }
複製代碼

TOP

返回列表