online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
public class Main { // TODO NOT FINISHED public static final String convert1(int x, int y, int z) { final int [] arr; if (x >= y) { if (x >= z) { if (y >= z) { // x,y,z arr = new int[] { x, y, z }; } else // if (y < z) { // x,z,y arr = new int[] { x, z, y }; } } else // if (z > x) { // y > z > x if (y >= z) { // x,y,z arr = new int[] { y, z, x }; } // z > x > y else // if (y < z) { // x,z,y arr = new int[] { x, z, y }; } } } else // y > x { if (x >= z) { if (y >= z) { // y,x,z arr = new int[] { y,x,z }; } else // if (y < z) { // z,y,x arr = new int[] { y,x,z }; } } else // if (z > x) { // y > z > x if (y >= z) { // x,y,z arr = new int[] { y, z, x }; } // z > x > y else // if (y < z) { // x,z,y arr = new int[] { x, z, y }; } } } int first = arr[0]; int middle = arr[1]; int last = arr[2]; String s = "" + first + middle + last; return s; } // 754 public static final String convert2(int x, int y, int z) { final int maxXY = Math.max(x, y); final int first = Math.max(maxXY, z); final int minYZ = Math.min(y, z); final int last = Math.min(x, minYZ); //final int minXY = Math.min(x, y); //final int minXZ = Math.min(x, z); final int maxXZ = Math.max(x, z); final int maxYZ = Math.max(y, z); /* int middle = Math.max(maxXY, minXZ); middle = Math.min(middle, maxXZ); middle = Math.max(middle, minXY); middle = Math.min(middle, first); middle = Math.max(middle, last); */ int middle = Math.min(first, maxXY); middle = Math.min(middle, maxYZ); middle = Math.min(middle, maxXZ); String s = "" + first + middle + last; /* if (!"754".equals(s)) // DEBUG { System.out.println(maxXY); System.out.println(maxYZ); System.out.println(maxXZ); System.out.println(minXY); System.out.println(minYZ); System.out.println(minXZ); }*/ return s; } public static int[][] tests = new int[][] { { 4, 5, 7 }, { 4, 7, 5 }, { 5, 4, 7 }, { 5, 7, 4 }, { 7, 4, 5 }, { 7, 5, 4 } }; public static final void test1() { int x = 5; int y = 4; int z = 7; String s1 = convert1(x, y, z); System.out.println(s1); } public static final void test2() { int i = 1; for(final int[] row : tests) { System.out.println("TEST #"+ i++); int x = row[0]; int y = row[1]; int z = row[2]; String s2 = convert1(x, y, z); System.out.println(s2); } } public static final void main(String[] args) { test2(); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue