fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. unsigned child,count,value=0,sum=0;
  7. for(cin>>child;child--;cout<<sum<<endl) for(cin>>count;count--;sum+=value) cin>>value;
  8. return 0;
  9. }
Success #stdin #stdout 0s 3344KB
stdin
2
5 1 2 3 2 1
3 2 1 98
stdout
9
110