@@ -0,0 +1,1062 @@
+public class Solution037 %7B%0A%0A%09static int digs;%0A%09static int sum = 0;%0A%09%0A%09public static void main(String%5B%5D args) %7B%0A%09%09%0A%09%09String digits = %22123579%22;%0A%09%09%0A%09%09for (digs = 2; digs%3C=7; digs++) %7B%0A%09%09%09combi(digits);%09%0A%09%09%7D%0A%09%09System.out.println(sum);%0A%09%7D%0A%0A%09static void combi(String s) %7B%0A%09%09combi(%22%22, s);%0A%09%7D%0A%0A%09static void combi(String prefix, String s) %7B%0A%09%09int length = digs;%0A%09%09if (prefix.length() == length) %7B%0A%09%09%09if (isPrime(prefix)) %7B%0A%09%09%09%09boolean b = true;%0A%09%09%09%09for (int i = 1; i %3C length; i++) %7B%0A%09%09%09%09%09if (!isPrime(prefix.subSequence(0, i)+%22%22)) %7B%0A%09%09%09%09%09%09b = false;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09for (int i = 1; i %3C length; i++) %7B%0A%09%09%09%09%09if (!isPrime(%22%22 + prefix.subSequence(i, length))) %7B%0A%09%09%09%09%09%09b = false;%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%09if (b)%0A%09%09%09%09%09sum = sum + Integer.valueOf(prefix);%0A%09%09%09%7D%0A%09%09%7D else %7B%0A%09%09%09for (int i = 1; i %3C= s.length(); i++) %7B%0A%09%09%09%09combi(prefix + s.charAt(i - 1), s);%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%0A%09static boolean isPrime(String s) %7B%0A%09%09if (Integer.valueOf(s) == 1)%0A%09%09%09return false;%0A%09%09for (int n = 2; n * n %3C= Integer.valueOf(s); n++) %7B%0A%09%09%09if (Integer.valueOf(s) %25 n == 0)%0A%09%09%09%09return false;%0A%09%09%7D%0A%09%09return true;%0A%09%7D%0A%7D%0A

Create solution037.java