@@ -0,0 +1,1490 @@
+package coding4fun;%0A%0A/**%0A * Determine if the binary representation of a positive integer is a palindrome.%0A * %0A * Input: 1 --%3E 1 in binary%0A * Output: true%0A * %0A * Input: 3 --%3E 11 in binary%0A * Output: true%0A * %0A * Input: 5 --%3E 101 in binary%0A * Output: true%0A * %0A * Input: 6 --%3E 110 in binary%0A * Output: false%0A * %0A * Input: 7 --%3E 111 in binary%0A * Output: true%0A * %0A * Input: 9 --%3E 1001 in binary%0A * Output: true%0A * %0A * Input: 13 --%3E 1101 in binary%0A * Output: false%0A */%0Apublic class Problem12 %7B%0A    private static boolean isBinaryPalindrome(int x) %7B%0A        int x1 = x;%0A        int n = 0;%0A        while (x1 %3E 0) %7B%0A            n++;%0A            x1 = x1 %3E%3E 1;%0A        %7D%0A        for (int i = 0; i %3C n/2; i++) %7B%0A            if ((x %3E%3E (n-1-i) & 1) != (x %3E%3E i & 1)) %7B%0A                return false;%0A            %7D%0A        %7D%0A        return true;%0A    %7D%0A    %0A    public static void main(String%5B%5D args) %7B%0A        int x = 1;%0A        System.out.println(x + %22: %22 + isBinaryPalindrome(x));%0A        %0A        x = 3;%0A        System.out.println(x + %22: %22 + isBinaryPalindrome(x));%0A        %0A        x = 5;%0A        System.out.println(x + %22: %22 + isBinaryPalindrome(x));%0A        %0A        x = 6;%0A        System.out.println(x + %22: %22 + isBinaryPalindrome(x));%0A        %0A        x = 7;%0A        System.out.println(x + %22: %22 + isBinaryPalindrome(x));%0A        %0A        x = 9;%0A        System.out.println(x + %22: %22 + isBinaryPalindrome(x));%0A        %0A        x = 13;%0A        System.out.println(x + %22: %22 + isBinaryPalindrome(x));%0A    %7D%0A%7D%0A

Add problem 12