From acaca360e7d4f1fc5f78c5072a78a629e90af1d7 Mon Sep 17 00:00:00 2001 From: guixu0320 <3488249364@qq.com> Date: Thu, 17 Oct 2024 15:05:37 +0800 Subject: [PATCH] jinzhi_lj --- jinzhi.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jinzhi.java b/jinzhi.java index 41f7b5a..41178e6 100644 --- a/jinzhi.java +++ b/jinzhi.java @@ -2,7 +2,7 @@ import javax.swing.JOptionPane; public class jinzhi { - // 将数字从 'fromBase' 转换为 'toBase'111 + // 将数字从 'fromBase' 转换为 'toBase' public static String convertBase(String number, int fromBase, int toBase) { // 第一步:从 'fromBase' 转换为十进制(base 10) int decimalNumber = 0; @@ -58,9 +58,9 @@ public class jinzhi { // 转换数字并打印结果 String result = convertBase(number, fromBase, toBase); - String message111 = "进制为 " + fromBase + " 的数: " + number + " 在进制为 " + toBase + " 的数是: " + result; + String message = "进制为 " + fromBase + " 的数: " + number + " 在进制为 " + toBase + " 的数是: " + result; // 使用弹窗显示结果 - JOptionPane.showMessageDialog(null, message111); + JOptionPane.showMessageDialog(null, message); } }