原本题目是这样的:
A zoo in Guangzhou determines the prices of each ticket based on the age of the customer. Customers 2 years of age and less are given a free ticket. Children between 3 and 12 years of age (inclusive) cost $14.00 per ticket. Seniors aged 65 years (inclusive) and over cost $18.00 per ticket. The ticket price for all other guests is $23.00.
Create a program that begins by asking for the age of all of the guests in a group with one age entered on each line. The user will enter a blank line to indicate that there are no more guests in the group. Then your program should display the admission cost for the group with an appropriate message。
通过某道翻译如下:
广州一家动物园根据顾客的年龄来决定每张门票的价格。2岁及以下的顾客可免费获赠门票一张。3至12岁的儿童(含)票价为每张$14.00。65岁(含65岁)以上的老年人票价为每张18.00美元。所有其他客人的票价是23美元。创建一个程序,首先要求在每一行输入一个年龄的所有客人的年龄。用户将输入一个空白行,以指示组中没有更多的来宾。然后,您的程序应该用适当的消息显示该组的入场费(求出随机输入年龄的票价费用总和即可)。
计算机老师说,最后一个没有要求写出来,不太会~~求各位大神帮助改正