Jack’s Birthday Presents

advertisement
Jack’s Birthday Presents
Filename: money
The Problem
Jack’s birthday was yesterday and he received a large number of presents! Yay presents!
Most of his presents were money and Jack realized that he has no idea how much money
he got! Can you help him figure out how much money he has?
The Input
You will be given an integer n (1 ≤ n ≤ 1000) which describes the number of test cases
that will follow. For each test case there will be an integer m (1 ≤ m ≤ 1000) which
describes the number of presents that were cash he got. Each present of money will be
represented by and integer denoting how much cash that present was for. Each present
will have a value between 1 and 1000.
The Output
For each test case simply output “Birthday#d: Jack got i dollars!” where d is the test case
number, and i represents the sum of the values for his presents for that case.
Sample Input
3
2
1 2
5
1 1 2 3 4
10
1 1 1 1 1 1 1 1 1 11
Sample Output
Birthday#1: Jack got 3 dollars!
Birthday#2: Jack got 11 dollars!
Birthday#3: Jack got 20 dollars!
Download