HDU 1753 简单大数

View Code
 1 import java.util.*;
 2 import java.math.*;
 3 import java.io.*;
 4 
 5 public class Hdu1715{
 6    public static void main(String args[]){
 7     String s1;
 8     BigDecimal a,b;
 9     Scanner cin = new Scanner(System.in);
10     
11     while(cin.hasNext()){
12      
13      a = cin.nextBigDecimal();
14      b = cin.nextBigDecimal();
15      a = a.add(b);
16      s1 = a.stripTrailingZeros().toPlainString(); 
17      System.out.println(s1);
18     } 
19     
20     
21    }
22    
23 }
posted @ 2012-09-04 19:19  zhongya  阅读(159)  评论(0编辑  收藏  举报