#K49912. Books Signed
Books Signed
Books Signed
You are given multiple datasets. Each dataset starts with an integer (n) representing the number of authors, followed by a line containing (n) integers where each integer represents the number of books an author can sign. Your task is to compute the total number of books signed for each dataset.
For each dataset with authors signing (b_1, b_2, \ldots, b_n) books respectively, you need to compute the sum
[
S = \sum_{i=1}^{n} b_i
]
and output (S) for each dataset in the order they are given. The input terminates when (n = 0), and that dataset should not be processed.
inputFormat
The input is provided via standard input and consists of multiple datasets. For each dataset, the first line contains a single integer (n) (with (n \ge 1)) representing the number of authors. The following line contains (n) space-separated integers, where each integer is the number of books an author can sign. The input terminates with a dataset where (n = 0); this dataset should not be processed.
outputFormat
For each dataset (except the terminating one), output a single line containing the total number of books signed.## sample
5
3 1 4 1 5
0
14
</p>