@@ -0,0 +1,756 @@
+%0Apublic class ReverseInt %7B%0A%0A%09public static void main(String%5B%5D args) %7B%0A%0A%09%09int x = 12345; // -%3E 54321   size 4%0A%09%09int y = 12340; // -%3E 4321%0A%09%09int z = 679;   // -%3E 679     size 2%0A%09%09%0A%09%09System.out.println(reverse(x));%0A%09%09System.out.println(reverse(y));%0A%09%09System.out.println(reverse(z));%0A%09%7D%0A%09%0A%09public static int getSize(int x) %7B%0A%09%09return ((int) Math.floor(Math.log10(x)));%0A%09%7D%0A%09%0A%09public static int reverse(int x) %7B%0A%09%09int size = getSize(x);%0A%09%09int reversed = 0;%0A%09%09int iter = 0;%0A%09%09while(x %3E 0) %7B%0A%09%09%09int lastDigit = x %25 10;%0A%09%09%09x = x / 10;%0A%09%09%09%0A%09%09%09// if x was 5 and size was 4 we want to add %0A%09%09%09// 50000%0A%09%09%09// next iter...%0A%09%09%09// if x was 4 then size is actually 3 %0A%09%09%09reversed += lastDigit * ((int) Math.pow(10, size - iter));%0A%09%09%09iter++;%0A%09%09%7D%0A%09%09%0A%09%09return reversed;%0A%09%7D%0A%0A%7D%0A

Create ReverseInt.java