Ugly Numbers(1.5.8)

作者: AliciaDimarco 分类: 算法与数据结构 发布时间: 2014-10-25 02:40 阅读: 1,996

Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d
& %I64u

Submit Status

Description

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, … 
shows the first 10 ugly numbers. By convention, 1 is included. 
Given the integer n,write a program to find and print the n’th ugly number. 

Input

Each line of the input contains a postisive integer n (n <= 1500).Input is terminated by a line with n=0.

Output

For each line, output the n’th ugly number .:Don’t deal with the line with n=0.

Sample Input

Sample Output


This article is automatically posted by WP-AutoPost : WordPress自动采集发布插件
如何申请百度翻译API Key?,WP-AutoPost

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注