题解 | #又一版 A+B#
又一版 A+B
https://www.nowcoder.com/practice/9255c05d45b8406c9b588d7c57aa920b
import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { int radix = scanner.nextInt(); if (radix==0) break; String s1 = scanner.next(); String s2 = scanner.next(); BigInteger n1 = new BigInteger(s1); BigInteger n2 = new BigInteger(s2); System.out.println(n1.add(n2).toString(radix)); } } }