From 7ccb170c95fc5fccc99b0ec5552b2ebcf7dead1f Mon Sep 17 00:00:00 2001 From: lzy1227 Date: Thu, 17 Oct 2024 14:29:18 +0800 Subject: [PATCH] v2 --- computer/computer.java | 25 ------------------------- out/production/computer/computer.class | Bin 2533 -> 2564 bytes 2 files changed, 25 deletions(-) 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 647caca5fd58665aef6935752712d9d0f85b6c87..75506ce36352b7dbf073541e7062362b9f49b435 100644 GIT binary patch literal 2564 zcmaJ?Yf}?f7=D&)vSC>yhyev+QHzC$f(50dR-D23MpeGmm zaX^I+Z;930Uc95?T^tk=-HTo^N4$s%xZ%Yi1$`>|VG7V;ad<>QOoC^#88=f+5?oc) zT@vJ$MAVQ_&~CFLvPFZHWFVt4uCc%AFkELl@66>hhXQsGr;os!{ zxbQenj|Y|nE$Z0ra`ZhhBi@(lr{{1=j~waH2eZ-TXK|g0tqe&-($-eJkkMSr7|_jl z)Sz)!JUu{GEF+nYF`#Ah@LSVnjK~o0NkU#E5kG2JDaS$8La8q7(rsSak>{cXjwL9`h#rrN*oz$Pbjpm?h8-aR>atDifhcDxv6!6 zTn#I*Qo(?Rdc-v(FsR@?4Hl9bQb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