java 写 高精度加法 HDU1002

import java.util.*;  
import java.math.*;  
import java.io.*;  
public class  Main     
{  
    public static void main( String[] args  )  
    {  
       Scanner cin=new Scanner(new BufferedInputStream (System.in)  );    
       BigInteger a,b,c;                   
       int t,num=0;  
       t=cin.nextInt();                  
       while( t-->=1 )  
       {  
           num++;   
           a=cin.nextBigInteger();              
           b=cin.nextBigInteger();  
           c=a.add(b);  
           System.out.println("Case "+num+":");          
           System.out.println(a + " + " + b + " = "+c);  
           if(t!=0)System.out.println("");  
       }  
    }  
}  

你可能感兴趣的:(【编程题】)