返回列表 發帖
  1. package hi87;

  2. import java.util.Scanner;
  3. public class JPA02 {
  4.         static Scanner s=new Scanner(System.in);
  5.    
  6.     public static void main(String[] args) {
  7.     System.out.println("Input:");
  8.     int ss=s.nextInt();
  9.     int mm=s.nextInt();
  10.     if(ss>mm)
  11.     {
  12.              System.out.println(ss+" is larger than "+mm);
  13.     }
  14.     else if(ss<mm)
  15.     {
  16.              System.out.println(mm+" is larger than "+ss);
  17.     }
  18.     else
  19.     {
  20.              System.out.println(ss+" equal "+mm);
  21.     }
  22.     System.out.println("Input:");
  23.     int oo=s.nextInt();
  24.     int pp=s.nextInt();
  25.     if(oo>pp)
  26.     {
  27.              System.out.println(oo+" is larger than "+pp);
  28.     }
  29.     else if(oo<pp)
  30.     {
  31.              System.out.println(pp+" is larger than "+oo);
  32.     }
  33.     else
  34.     {
  35.              System.out.println(oo+" equal "+pp);
  36.     }
  37.     }
  38. }
複製代碼

TOP

返回列表