public static String toBinary(String hexNumber) { //напишите тут ваш код if (hexNumber == "" || hexNumber == null) return ""; else { String tob = ""; for (int i = hexNumber.length() - 1; i >= 0; i--) { int o = 0; String t = ""; if (hexNumber.charAt(i) >= '1' && hexNumber.charAt(i) <= '9') { int real = Character.getNumericValue(hexNumber.charAt(i)); while (real > 0) { o = real % 2; char c = HEX.charAt(o); t = c + t; real = real / 2; } } else if (hexNumber.charAt(i) >= 'a' && hexNumber.charAt(i) <= 'f') { int no = HEX.indexOf(hexNumber.charAt(i)); while (no > 0) { o = no % 2; char c = HEX.charAt(o); t = c + t; no = no / 2; } } else if (hexNumber.charAt(i) == '0') t = "0000" + t; else return ""; tob = t + tob; } return tob; } } прошу прощения за "говнокод", но я искренне не понимаю в чем проблема второго требования, вывод корректный. Надеюсь на вашу помощь :(