View Code of Problem 112

#include <stdio.h>
#include <string.h>
#include <math.h>
#define N 1000
/*int main()
{
	int a[N];
	while(gets(a)!=EOF)
	{
		
	}
}*/
int main()
{
	int n;
	int a,b;
	int sum=0;
	scanf("%d",&n);
	while(n--)
	{
		scanf("%d",&a);
		if(a==0)
			break;
		sum+=a;
	
	}
		printf("%d",sum);
}

Double click to view unformatted code.


Back to problem 112