@@ -0,0 +1,957 @@
+package leetcode;%0A%0Apublic class Task7 %7B%0A%0A    public static void main(String%5B%5D args) %7B%0A        System.out.println(new Task7().reverse(123));%0A        System.out.println(new Task7().reverse(-123));%0A        System.out.println(new Task7().reverse(120));%0A        System.out.println(new Task7().reverse(1534236469));%0A        System.out.println(new Task7().reverse(-2147483648));%0A    %7D%0A%0A    public int reverse(int x) %7B%0A        StringBuilder reversedX = new StringBuilder();%0A        int firstSymbolIndex = 0;%0A        if (x %3C 0) %7B%0A            reversedX.append(%22-%22);%0A            firstSymbolIndex = 1;%0A        %7D%0A        String xStr = String.valueOf(x);%0A        for (int i = xStr.length() - 1; i %3E= firstSymbolIndex; i--) %7B%0A            reversedX.append(xStr.charAt(i));%0A        %7D%0A        long reversedXLong = Long.parseLong(reversedX.toString());%0A        return reversedXLong %3C= Integer.MAX_VALUE && reversedXLong %3E= Integer.MIN_VALUE ? (int) reversedXLong : 0;%0A    %7D%0A%7D%0A

Add Task7