View Code of Problem 112

#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int n,x;
	while(cin>>n&&n){
		int sum=0;
		for(int i=0;i<n;i++){
			cin>>x;
			sum+=x;
		}
		cout<<sum<<endl;
		
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 112