View Code of Problem 112

#include<bits/stdc++.h>
using namespace std;

int main() {

	int n;
	while(cin>>n){
		if(n==0){
			break;
		} 
		int sum=0;
		while(n--){
			int k;
			cin>>k;
			sum+=k; 
		}
		cout<<sum<<endl;
	}
	
	return 0;
}

Double click to view unformatted code.


Back to problem 112