hdu 1047 java水过
import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) { Scanner cin=new Scanner(System.in); int i,n; BigInteger a,b; n=cin.nextInt(); for(i=0;i<n;i++) { if(i!=0) System.out.println(); b=BigInteger.ZERO; while(cin.hasNextBigInteger()) { a=cin.nextBigInteger(); if(a.intValue()==0) break; b=b.add(a); } System.out.println(b); } } }
posted on 2011-05-10 08:06 more think, more gains 阅读(165) 评论(0) 编辑 收藏 举报