/ OPS / 题库 /

Ugly Numbers

Ugly Numbers

#描述#
Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... shows the first 11 ugly numbers. By convention, 1 is included.
Write a program to find and print the n’th ugly number.

#格式#
##输入格式##
Every integer number (≤1500)describing position of ugly number from 1.If integer number is 0,the process should end.
Maybe there are 10000 integer numbers on input data.

##输出格式##
Every integer given should output a line as shown below,
The &ltn&gtth ugly number is &ltnumber&gt.
With &ltn&gt replaced by the integer number and &ltnumber&gt replaced by the number computed.

#样例1#
##样例输入1##

5 16

##样例输出1##

The 5th ugly number is 5.
The 16th ugly number is 25.


#限制#
1000ms
32768KB

#提示#

#来源#

信息

ID
1089
难度
5
分类
category1 点击显示
标签
递交数
0
已通过
0
通过率
?
上传者