大数相加bigInteger

import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

class solution
{
 private BigInteger m,n;
 private int T=0;
 private int Index=1;
 private Scanner iner=new Scanner(System.in);
 
 public void add()
 {
     T=iner.nextInt();
     while(T!=0)
     {
         m=iner.nextBigInteger();
         n=iner.nextBigInteger();
         System.out.println("Case "+Index+":");
         System.out.println(m+" + "+n+" = "+m.add(n));
         System.out.println();
         T--;
         Index++;
     }
 }
  
}

public class Main {
    public static void main(String[] args) {
        solution space = new solution();
        space.add();
    }
}

 

posted @ 2019-10-12 08:59  pycodego  阅读(447)  评论(0编辑  收藏  举报