30 26 0
3 2
#include<iostream> #include<cmath> using namespace std; bool pri(int k) { int i; for(i=2;i<=sqrt(k);i++) if(k%i==0) break; if(i>sqrt(k)) return 1; return 0; } int main() { int n; while(cin>>n,n) { int count=0; for(int k=2;k<n/2;k++) if(pri(k)&&pri(n-k)) count++; cout<<count<<endl; } return 0; }
原文地址:http://blog.csdn.net/lsgqjh/article/details/44949885