2013
11-09

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, …

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.

1
2
9
0


1
2
10


//* @author  [email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */
import java.util.Scanner;
import java.util.Vector;
public class Main {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
Vector< Long> v=new Vector< Long>();
int i=0,j=0,k=0;
while(v.size()< 1500){
}