public class problem40 { public static void main(String[] args) { StringBuffer a = new StringBuffer(); a.append("123456789"); int n =1; while(n<=100000) { for(int i = 0; i <=9; i++) { String elem = Integer.toString(n)+Integer.toString(i); a.append(elem); } n++; } int p =1; int c =1; for (int i = 0; i <= 6; i++) { c=c*(a.charAt(p-1)-48); p=p*10; } System.out.println(c); } }
No hay comentarios:
Publicar un comentario