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;
}
posted @ 2011-05-01 12:10  金海峰  阅读(235)  评论(0编辑  收藏  举报