import java.util.Scanner; public class If_else_if_03 { /************************************ IF else if型 ************************************/ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a,b,sa=0; System.out.print("aはいくつ?"); a=sc.nextInt(); System.out.print("bはいくつ?"); b=sc.nextInt(); if (a>b) sa=a-b; else sa=b-a; if (a==b) System.out.print("aとbは同じ値です\n"); else if (a>b) System.out.print("aが"+sa+"大きいです\n"); else System.out.print("bが"+sa+"大きいです\n"); System.out.print("\nプログラムを終了します\n"); } }