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 t;
    	   t=cin.nextInt();
    	   for(int i=1;i<=t;i++)
    	   {
    		   BigInteger a,s,b;
    		   s=BigInteger.valueOf(0);
    		   b=BigInteger.valueOf(0);
    		   while(cin.hasNextBigInteger())
    		   {
    			   a=cin.nextBigInteger();
    			   if(a.compareTo(b)==0)
    				   break;
    			   s=s.add(a);
    		   }
    		   System.out.println(s);
    		   if(i!=t)
    		   {
    			   System.out.println();
    		   }
    	   }
       }
}

  

posted on 2011-09-23 16:48  枫叶飘泪  阅读(265)  评论(0编辑  收藏  举报