View Code of Problem 112

#include<iostream>

using namespace std;

int main() {
	int n;
	int t;
	while (cin >> n) {
		int sum = 0;
		if (n == 0) {
			return 0;
		}
		else {
			while (n--) {
				cin >> t;
				sum += t;
			}
		}
		cout << sum << endl;
	}
}

Double click to view unformatted code.


Back to problem 112