You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
386 B
C++

#include <cstdio>
using namespace std;
int main()
{
bool flag = true;
int a, b, n, m;
scanf("%d", &n);
while (n--)
{
if (flag)
flag = false;
else
putchar('\n');
scanf("%d", &m);
a = 0;
while (m--)
scanf("%d", &b), a += b;
printf("%d\n", a);
}
return 0;
}