首页 > 编程语言 > 详细

杭电HDOJ--ACM1002(JAVA解题,运用BigInteger)

时间:2016-05-17 15:56:48      阅读:237      评论:0      收藏:0      [点我收藏+]

技术分享

 
 
JAVA解题:
 
import java.util.*;

import java.io.*;
import java.math.BigInteger;

public class Main{

    public static void main(String[] arg){
        Scanner scan = new Scanner(new BufferedInputStream(System.in));
        int n = scan.nextInt();
        int l = n;
        while(n--!=0){
            BigInteger integer = new BigInteger(scan.next());
            BigInteger integer2 = new BigInteger(scan.next());
            System.out.println("Case " + (l-n+1) + ":");
            System.out.println(integer + " + " + integer2  +  " = " +integer.add(integer2));
            if(n!=1){
                System.out.println();
            }
        }
    scan.close(); }
}

 

杭电HDOJ--ACM1002(JAVA解题,运用BigInteger)

原文:http://www.cnblogs.com/xiezie/p/5501901.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!