From d3208def735dc8749caaf92b95fd1b3094c606f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=9F=8E?= <2304508674@qq.com> Date: Thu, 10 Oct 2024 17:17:29 +0800 Subject: [PATCH] 3 --- Calculator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Calculator.java b/Calculator.java index 5405f22..ce5d201 100644 --- a/Calculator.java +++ b/Calculator.java @@ -3,7 +3,6 @@ import java.util.Scanner; public class Calculator { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); - System.out.print("请输入要转换的数:"); String num = scanner.nextLine(); @@ -16,7 +15,7 @@ public class Calculator { // 调用转换方法 String converted = convertBase(num, fromBase, toBase); - System.out.printf("%s (base %d) 转换为 base %d 是 %s%n", num, fromBase, toBase, converted); + System.out.printf("%s (%d进制) 转换为 (%d进制) 是 %s%n", num, fromBase, toBase, converted); } public static String convertBase(String num, int fromBase, int toBase) {