Compare commits

..

No commits in common. '4637db976e11fb36e558795013c3dccf93c0d830' and '01a2898220fbc42bc23c8743e03163ff68ecf81d' have entirely different histories.

@ -4,13 +4,10 @@ import java.util.Scanner;
public class Calculator { public class Calculator {
public static void main(String[] args) { public static void main(String[] args) {
Scanner scanner = new Scanner(System.in); Scanner scanner = new Scanner(System.in);
<<<<<<< HEAD
=======
System.out.print("请输入源进制(2-16)"); System.out.print("请输入源进制(2-16)");
int fromBase = scanner.nextInt(); int fromBase = scanner.nextInt();
System.out.print("请输入目标进制(2-16)"); System.out.print("请输入目标进制(2-16)");
int toBase = scanner.nextInt(); int toBase = scanner.nextInt();
>>>>>>> origin/master
System.out.print("请输入要转换的数:"); System.out.print("请输入要转换的数:");
String num = scanner.nextLine(); String num = scanner.nextLine();
@ -18,7 +15,7 @@ public class Calculator {
// 调用转换方法 // 调用转换方法
String converted = convertBase(num, fromBase, toBase); String converted = convertBase(num, fromBase, toBase);
System.out.printf("%s (%d进制) 转换为 (%d进制) 是 %s%n", num, fromBase, toBase, converted); System.out.printf("%s (base %d) 转换为 base %d 是 %s%n", num, fromBase, toBase, converted);
} }
public static String convertBase(String num, int fromBase, int toBase) { public static String convertBase(String num, int fromBase, int toBase) {

Loading…
Cancel
Save