标签:com http class blog style div img code java size javascript
没说的 暴力打表
#include<iostream> #include<cmath> using namespace std; int a[62768]; int b[42768]; int prime[42768]; int main() { int n=0,j,i; memset(b,0,sizeof(b)); memset(a,0,sizeof(a)); for(i=2;i<32767/2;i++) { if(b[i]) continue; for(j=i*2;j<=32767;j+=i) b[j]=1; } for(i=2;i<=32767;i++) if(!b[i]) prime[n++]=i; for(i=0;i<n;i++) for(j=0;j<n;j++) a[prime[i]+prime[j]]++; while(scanf("%d",&n)!=EOF) { if(n==0) break; printf("%d\n",(a[n]+1)/2); } return 0; }
标签:com http class blog style div img code java size javascript
原文地址:http://www.cnblogs.com/zhangdashuai/p/3697999.html