package margusmartseppcode.From_40_to_49; public class Problem_40 { public static void main(String[] args) { int size = 100000, result = 1; StringBuilder sb = new StringBuilder(size + 200); for (int i = 1; sb.length() <= 100000; i++) sb.append(i); for (int count = 1; count <= size; count *= 10) result *= Character.getNumericValue(sb.charAt(count - 1)); System.out.println(result); } }
No comments:
Post a Comment