标签:
3123456789012345678901234567890 123456789012345678901234567890 123456789012345678901234567890 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789000
3703703670370370367037037036703703703670370370367037037036700
注:格式问题!!
import java.math.BigInteger;
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
while(n-->0){
BigInteger sum=BigInteger.ZERO;
BigInteger x;
while(sc.hasNextBigInteger()){
x=sc.nextBigInteger();
if(x.equals(BigInteger.valueOf(0))){
System.out.println(sum);
break;
}else{
sum=sum.add(x);
}
}
if(n!=0){
System.out.println();
}
}
}
}
标签:
原文地址:http://blog.csdn.net/u011479875/article/details/45242027