View Code of Problem 112

#include<stdio.h>
 
int main()
{
	int n;
	int x, sum = 0;
	scanf("%d", &n);
	while(n != 0)
	{
		for(int i = 0; i < n; i++)
		{
			scanf("%d", &x);
			sum += x;
		}
		printf("%d\n", sum);
		scanf("%d", &n);
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 112