View Code of Problem 112

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

Double click to view unformatted code.


Back to problem 112