View Code of Problem 112

#include <iostream>
#include <cstdio>
using namespace std;
int main(){
    int N,a,sum;
    while(cin>>N){
        if(N==0)
            break;
        else
            while(N--){
                cin>>a;
                sum+=a;
            }
        cout<<sum<<endl;
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 112