// Get three integers entered as commandline arguments and write them // out in sorted order. class Sort3 { public static void main(String[] args) { int a = Integer.parseInt(args[0]); int b = Integer.parseInt(args[1]); int c = Integer.parseInt(args[2]); if (b > c) { int temp = b; b = c; c = temp; } // at this point b <= c if (a <= b) System.out.println(a + " " + b + " " + c); else if (a <= c) System.out.println(b + " " + a + " " + c); else System.out.println(b + " " + c + " " + a); } }