Pro.ID22805 TitleNumerical Frequency Title链接http://10.20.2.8/oj/exercise/problem?problem_id=22805 AC10 Submit16 Ratio62.50% 时间&空间限制描述The National Security Agency (NSA) has invented a new cryptography algorithm. This algorithm is supposed to be completely unbreakable, and is based on several interacting components. One important component is a key based on the date on which a message is sent. The NSA plans to take the factorial of the day of the year, and count the occurrences of each digit. Remember that the factorial n! is just n*(n-1)*(n-2) .. * 1. Thus, the factorial 4! is 24. In this example, there is one occurrence of the digit 2: one occurrence of the digit 4, and zero occurrences of every other digit. Your program will be given a list of numbers as input and should output: for each number, the count of each digit, including digits for which the count is zero. 输入Your program will take as input a series of numbers, separated by spaces, and terminated by a 0. All numbers will be integers x such that 1 ≤ x ≤ 366. Do not process the 0; it is a terminator only. 输出Description The National Security Agency (NSA) has invented a new cryptography algorithm. This algorithm is supposed to be completely unbreakable, and is based on several interacting components. One important component is a key based on the date on which a message is sent. The NSA plans to take the factorial of the day of the year, and count the occurrences of each digit. Remember that the factorial n! is just n*(n-1)*(n-2) .. * 1. Thus, the factorial 4! is 24. In this example, there is one occurrence of the digit 2: one occurrence of the digit 4, and zero occurrences of every other digit. Your program will be given a list of numbers as input and should output: for each number, the count of each digit, including digits for which the count is zero. Input Your program will take as input a series of numbers, separated by spaces, and terminated by a 0. All numbers will be integers x such that 1 ≤ x ≤ 366. Do not process the 0; it is a terminator only. Output Your program should process each number and output the number of occurrences for each digit. Each input number should be printed, followed by an ! and a new line. Then, each digit 0-9 should be printed on a separate line; followed by a colon ":" , a single space, and the number of occurrences. Sample Input 3 100 0 Sample Output 3! Source 样例输入3 100 0 样例输出3! 作者 |