poj2636
简单题
View Code
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
using namespace std;
int main()
{
//freopen("D:\\t.txt", "r", stdin);
int t;
scanf("%d", &t);
while (t--)
{
int n;
scanf("%d", &n);
int sum = 0;
for (int i = 0; i < n; i++)
{
int a;
scanf("%d", &a);
sum += a;
}
printf("%d\n", sum - n + 1);
}
return 0;
}