判断素数要会写哦
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
while(scan.hasNext()){
int n = scan.nextInt();
System.out.println(getCount(n));
System.out.println(n-getCount(n));
}
scan.close();
}
public static boolean isPrime(int n){
for(int i = 2; i<=Math.sqrt(n); i++){
if(n%i == 0){
return false;
}
}
return true;
}
public static int getCount(int n){
int i = n/2;
int j = n/2;
while(!isPrime(i) || !isPrime(j)){
i--;
j++;
}
return i;
}
}