View Code of Problem 112

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

} 












Double click to view unformatted code.


Back to problem 112