For this assignment, you are to write solutions to the following problems in C++. These problems are presented in the style of programming contests, where the input and output formats are very strict. In a contest setting, the elegance of the program is not considered, only its behavior. This is not the case for this assignment, however! You should strive to make your code as efficient and elegant as possible.
Problem Statement: Given a number, determine if it is perfect, deficient, or abundant.
Input: A list of N positive integers (none greater than 30,000), with 1 < N < 100. A 0 will mark the end of the list.
Output: The first line of output should read PERFECTION OUTPUT. The next N lines of output should list for each input integer whether it is perfect, deficient, or abundant, as shown in the example below. Format counts: each integer should be displayed, followed by two spaces, followed by the description of the integer in capital letters. The final line of output should read END OF OUTPUT.
Problem Statement: Read in the numbers for a series of games, including team names, the actual number of points scored by each team, and the predicted number of points. Also, read in a series of bets, including a gambler's name, the amount of the bet, a team name, and whether the bet is OVER or UNDER. Then, display the total amounts won or lost by each of the gamblers.
Input: The first line of input will contain a positive integer, G, specifying the number of games that can be bet on (1 <= G <= 15). The next G lines will contain the name of the visiting team, the number of points that team scored in the game, the name of the home team, the number of points scored by the home team, and the predicted number of points for the game. The next line of input will contain a positive integer, B, specifying the number of bets to be processed (1 <= B <= 30). The next B lines will contain the name of a gambler, the amount bet (a positive integer), the name of a team involved in a game, and the type of bet for that game (either "OVER" or "UNDER"). You may assume that team and gambler names consist of no more than 10 letters, and that all input values are separated by a single space.
Output: For each gambler listed, the total amount won or lost should be displayed on a line, listing that gambler's name, a single space, either the word "WON" or "LOST" (as appropriate), another space, and the total amount they won or lost. If the gambler broke even, the phrase "BROKE EVEN" should appear after their name. Gamblers should be listed in the order in which they first appeared in the input.