N 입력받기
int number = 1*10^N
for(i : number ~ 1*10^(N+1)-1) {
int index = N-1
boolean few = Few(i)
while(few) {
String strNumber = String.valueOf(i)
strNumber.substring(0,index)
nextNumber = Integer.parseInt(strNumber)
few = Few(nextNumber)
index--
if(index == 0) {
i 출력
}
}
i++
}
// 소수확인
public static boolean Few(int num, N) {
boolean few = true
for(i : 2~N-1 만큼 반복) {
int remainder = n%i
if( remainder == 0) {
few = false
return few
}
}
return few
}