标签:
Description
Input
Output
Sample Input
Sample Output
#include <iostream> #include <cstring> #include <cstdio> #include <algorithm> #include <queue> #include <vector> #include <iomanip> #include <math.h> using namespace std; #define FIN freopen("input.txt","r",stdin); #define INF 0x3f3f3f3f #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 typedef long long LL; int p[10005]; int s[5005]; int main() { //FIN int cas=0; for(int i=2; i<=10000; i++) { if(p[i]==0) { for(int j=i+i; j<=10000; j=j+i) { p[j]=1; } } } for(int i=2; i<=10000; i++) { if(p[i]==0) s[cas++]=i; } int n; while(~scanf("%d",&n)&&n) { int cnt=0; for(int i=3; i<n/2; i+=2) { if(!p[i]&&!p[n-i]) cnt++; } printf("%d\n",cnt); } }
标签:
原文地址:http://www.cnblogs.com/Hyouka/p/5721453.html