2098
2020-02-26 本文已影响0人
好名字_4d27
![](https://img.haomeiwen.com/i10312937/2887cafdce4d22a7.png)
import java.util.Scanner;
public class Main{
public static boolean Prime( int a){
if (a == 2)
return true;
for (int i = 2; i <=Math.sqrt(a); i++) {
if(a%i == 0 )
return false;
}
return true;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (sc.hasNext()){
int x=sc.nextInt();
if (x==0) break;
int i,c = 0;
for (i = 2; i < x-i ; i++) {
if(Prime(i)&&Prime(x-i))
c++;
}
System.out.println(c);
}
}
}