View Code of Problem 112

#include<stdio.h> 
void main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int sum=0,a[n];
		if(n==0)
			break;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&a[i]);
			sum+=a[i];
		}
		printf("%d\n",sum);
	}
}

Double click to view unformatted code.


Back to problem 112