【ACM】杭电OJ 1096

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/CSDN___CSDN/article/details/82927764

题目链接:杭电OJ 1096 

只要注意输出格式就好,其他没有问题!

#include <stdio.h>
int main ()
{
	int a,N,n,sum;
	scanf("%d",&N);
	while(N--)
	{
		sum=0;
		scanf("%d",&n);
		while(n--)
		{
			scanf("%d",&a);
			sum+=a;
		}
		if(N!=0)
		printf("%d\n\n",sum);
		else
		printf("%d\n",sum);
	}
	return 0;
}

猜你喜欢

转载自blog.csdn.net/CSDN___CSDN/article/details/82927764