题解 | #查找组成一个偶数最接近的两个素数#
查找组成一个偶数最接近的两个素数
http://www.nowcoder.com/practice/f8538f9ae3f1484fb137789dec6eedb9
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int pre = 0;
int rear = 0;
outer:
for(int i = n/2; i>=2; i--){
for(int j = 2; j<i; j++){
if(i%j==0){
continue outer;
}
}
pre = i;
rear = n-pre;
for(int k = 2; k<rear; k++){
if(rear%k==0){
continue outer;
}
}
break;
}
System.out.println(pre);
System.out.println(rear);
}
}