View Code of Problem 112

#include <iostream>
using namespace std;
int main(void){
	int a[10000];
	int n;
	while(cin>>n){
		int total=0;
		if(!n) return 0;
		while(n--){
			cin>>a[n];
			total+=a[n];
		}
		cout<<total<<endl;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 112