题解 | #又一版 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));
        }
    }
}

全部评论

相关推荐

点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务