A+B for Input-Output Practice (VIII)
#include<iostream>
using namespace std;
int main()
{
int n,i,j,sum = 0,N;
cin>>N;
for(j = 0 ; j < N ; j ++)
{
cin>>n;
int *a = new int[n];
for(i = 0 ; i < n ; i ++)
{
cin>>a[i];
}
for(i = 0 ; i < n ; i ++)
{
sum += a[i];
}
cout<<sum<<endl;
if(j != N-1 )
cout<<endl;
sum = 0;
delete[] a;
}
return 0;
}