Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int N,R,X;
- #define NO printf("%d is not the sum of two primes!\n",N);
- void pr(int a,int b){printf("%d is the sum of %s%d and %d.\n",N,a&1?"":"",a,b);}
- int main(void){
- gen();
- while(~scanf("%d",&N)){
- if(N<5){NO continue;}
- if(N&1){
- if(IS((N-2)))NO
- else pr(2,N-2);
- continue;
- }
- R=(upper_bound(P,P+L,N>>1)-P-1),X=1;
- if(P[R]*2==N)--R;
- while(~R&&X){
- if(!IS((N-P[R])))X=0,pr(P[R],N-P[R]);
- --R;
- }
- if(X)NO;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment