diff --git a/computer/computer.java b/computer/computer.java index 604be82..790ebab 100644 --- a/computer/computer.java +++ b/computer/computer.java @@ -22,31 +22,6 @@ public class computer { } // 将十进制数转换为R进制数 - public static String decimalToBase(int num, int r) { - if (num == 0) { - return "0"; - } - - StringBuilder result = new StringBuilder(); - - while (num > 0) { - int remainder = num % r; - if (remainder < 10) { - result.append(remainder); // 数字字符 - } else { - result.append((char) ('A' + (remainder - 10))); // 字母字符 - } - num /= r; - } - - return result.reverse().toString(); // 反转结果 - } - - // 将任意R进制数X从进制R_from转换到进制R_to - public static String convertBase(String x, int rFrom, int rTo) { - int decimalValue = baseToDecimal(x, rFrom); // 转换为十进制 - return decimalToBase(decimalValue, rTo); // 转换为目标进制 - } public static void main(String[] args) { Scanner scanner = new Scanner(System.in); diff --git a/out/production/computer/computer.class b/out/production/computer/computer.class index 647caca..75506ce 100644 Binary files a/out/production/computer/computer.class and b/out/production/computer/computer.class differ