标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 25673 Accepted Submission(s):
11239
#include<stdio.h> #define max 11000 int su[max]; int main() { int n,m,j,i,sum; for(i=1;i<=max;i++) { su[i]=1; } for(i=2;i<=max;i++) { if(su[i]==1) { for(j=i*i;j<=max;j+=i) { su[j]=0; } } } su[1]=0; while(scanf("%d",&n)&&n!=0) { sum=0; for(i=2;i<=n/2;i++) { if(su[i]&&su[n-i]&&i!=n-i) sum++; } printf("%d\n",sum); } return 0; }
标签:
原文地址:http://www.cnblogs.com/tonghao/p/4503027.html