public class Main { public static void main(String[] args) { String hex = toHex(12500); System.out.println(hex); if (hex.equalsIgnoreCase("30D4")) { System.out.println("测试通过"); } else { System.out.println("测试失败"); } } static String result = ""; static String toHex(int n) { if(n == 0) { return null; }else { toHex(n/16); result += Integer.toHexString(n%16); } return result; } }
Sign in to make a reply
革委坡