Poj1503

import java.math.BigInteger;

import java.util.Scanner;



public class Pone

{

	public static void main(String args[])

	{

		Scanner cin=new Scanner(System.in);

		//String a1=new String();

		int a1=0;

		String temp=new String();

		BigInteger a=BigInteger.valueOf(a1);

		while(true)

		{

			temp=cin.next();

			if(temp.equals("0")==true)

				break;

			BigInteger tp=new BigInteger(temp);

			a=a.add(tp);

		}

		System.out.println(a);

	}

}
1503就是计算几个大数之和

  

你可能感兴趣的:(poj)