#P283. 练46.2 求丑数
练46.2 求丑数
Description
We call a number "ugly" if it only contains factors , , and . For example, and are ugly numbers, but is not because it contains factor . By convention, we consider as the first ugly number.
First, define a function to determine if a number is ugly, then use it to output all ugly numbers between and , and count their total number.
Input Format
None
Output Format
The output consists of two parts:
First part: Output all ugly numbers between and , with integers per line, each integer taking up characters.
Second part: First output "Count: ", then output the total number of ugly numbers between and .
Sample
None 1 2 3 4 5 6 8 9 10 12
15 16 18 20 24 25 27 30 32 36
40 45 48 50 54 60 64 72 75 80
81 90 96 100
个数:34
Related
In following homework: