poj 1503 第一个java

import java.io.*;
import java.util.*;
import java.math.*;
public class Main
{
public static void main(String[] args)
{
String s;
BigInteger a,b,c;
Scanner sc=new Scanner(System.in);
Scanner cin=new Scanner(System.in);
b=BigInteger.valueOf(0);
while(cin.hasNext())
{
a=cin.nextBigInteger();
s=a.toString();
if(s.equals("0")) break;
b=b.add(a);
}
System.out.println(b);
}
}
posted @ 2011-10-17 18:59  Because Of You  Views(201)  Comments(0Edit  收藏  举报