#include<bits/stdc++.h> using namespace std; int main(){ int n,s=0,x; while(cin>>n){ if(n==0) break; while(n--){ cin>>x; s+=x; } cout<<s<<endl; } }
Double click to view unformatted code.