标签:
地址:http://acm.hdu.edu.cn/showproblem.php?pid=1047
1 import java.math.BigInteger; 2 import java.util.Scanner; 3 4 public class Main { 5 // static BigInteger one = new BigInteger("1"); 6 public static void main(String[] args) { 7 int i,T; 8 BigInteger m,sum; 9 Scanner cin = new Scanner(System.in); 10 T = cin.nextInt(); 11 for( i = 1; i <= T; ++i){ 12 sum = BigInteger.ZERO; 13 while(cin.hasNextBigInteger()){ 14 m = cin.nextBigInteger(); 15 if( m.equals(BigInteger.ZERO) ) 16 break; 17 sum = sum.add(m); 18 } 19 System.out.println(sum); 20 if(i<T) 21 System.out.println(); 22 } 23 } 24 }
标签:
原文地址:http://www.cnblogs.com/blueprintf/p/4703520.html