浙江省省赛2016同步赛L题_Very Happy Great BG

题目链接L题

一个简单的累和题目!!!

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <vector>
#include <cmath>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
const int maxn = 55555;
int sum[maxn << 2];

int main(void)
{
	//freopen("in.txt", "r", stdin);
	int T;
	int n;

	scanf("%d", &T);
	while (T--)
	{
		scanf("%d", &n);
		int sum = 0;
		sum += n;
		int i, j;
		for (i = 0; i < n; i++)
		{
			int t;
			scanf("%d", &t);
			sum += t;
		}
		printf("%d\n", sum);
	}
	return 0;
}

你可能感兴趣的:(浙江省省赛2016同步赛L题_Very Happy Great BG)