Ugly Numbers(1.5.8)

作者: AliciaDimarco 分类: 未分类 发布时间: 2014-10-25 02:40 阅读: 2,023

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

Submit Status


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. 


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


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



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