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