View Code of Problem 112

#include<stdio.h>
int main(){
	int a,b,i,k,c,d,s=0;
	while(scanf("%d",&k)){
		if(k!=0){
			while(k--){
			 scanf("%d",&a);
			 s+=a;
			}
		}else{
		   break;
		}
		printf("%d\n",s);
		s=0;
	
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 112