/* * Test 1 Question 3 content */ package t1q3; import java.util.Scanner; /** * @author jcmtiernan */ public class T1Q3 { /** * @param args the command line arguments */ public static void main(String[] args) { int a = 0, b = 0, c = 0; int x, y, z; Scanner input = new Scanner(System.in); // get user input to give values to a, b, and c System.out.print("Please enter a line of input that contains three integers : "); a = input.nextInt(); b = input.nextInt(); c = input.nextInt(); if (a < b) { if (c < a) { x = c; y = a; z = b; } else if (c < b) { x = a; y = c; z = b; } else { x = a; y = b; z = c; } } else // b <= a { if (c < b) { x = c; y = b; z = a; } else if (c < a) { x = b; y = c; z = a; } else { x = b; y = a; z = c; } } System.out.printf("\n%9s %6d %6d %6d \n","Inputs",a,b,c); System.out.printf("%9s %6d %6d %6d \n","Results",x, y, z); } }