|
|
back to boardMy code__I put it to help and to learn not for copy paste! import java.util.*; import java.io.*; import java.lang.String; public class P1014{ public static void main(String[] args){ Scanner in=new Scanner(System.in); PrintWriter out=new PrintWriter(System.out); long m=0; int i=0; String num; try{ int n=in.nextInt(); if(n==1) out.println("1"); else if(n<10) out.println("1"+n); else { for(i=9;i>1;i--) { if(n%i==0) { n=n/i; m=m*10+i; i++; }} if(n!=1) out.print("-1"); else{ String s=Long.toString(m); for(i=s.length()-1;i>=0;i--) out.print(s.charAt(i)); }} }catch(Exception e){ out.println(e); } out.flush(); }} For C++ code and other queqtions write imran_yusubov@yahoo.com Edited by author 10.09.2008 06:38 Re: My code__I put it to help and to learn not for copy paste! I think Mister Bean,too . Timus Online Judge is playground for intelligence of student information technology. Learn algorithm to solve is main. thank you Mister Bean, you help me very much. Edited by author 28.03.2010 18:31 |
|
|