/*********************************** 3個の数字のソート ************************************/ import java.util.*; public class If07Sort2 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a,b,c,w; System.out.print("aはいくつ-->"); a=sc.nextInt(); System.out.print("bはいくつ-->"); b=sc.nextInt(); System.out.print("cはいくつ-->"); c=sc.nextInt(); if ( a>b ) { w=a; a=b; b=w; } if ( b>c ) { w=b; b=c; c=w; } if ( a>b ) { w=a; a=b; b=w; } System.out.print("\n小さい順に並べます\n"); System.out.print(a+" "+b+" "+c+"\n"); } }