View Code of Problem 112

#include<bits/stdc++.h>
using namespace std;
#define max 100
int main(){
	int n,num,sum ;
	while(scanf("%d",&n)){
		if(n==0)exit(1);
		sum = 0;
		for(int i = 0;i<n;i++){
			cin>>num;
			sum+=num;	
		}
		cout<<sum<<endl;
		
	}
	return 0;
} 

Double click to view unformatted code.


Back to problem 112