//输入一个大于6的偶数,这个数一定能写成两个素数的和,比如8=3+5;
#include<iostream>
using namespace std;
int prime(int x);
void gotbaha(int x);
void main(){
    int a;
    cin>>a;
    if((a<6)||(a%2==1))
        cout<<"the wrong number"<<endl;
    else
        gotbaha(a);
        
}

int prime(int x){
   int i;
 for(i=2;i<x;i++)
     if(x%i==0) return NULL;
 return x;
}

void gotbaha(int x){
    int p,q,i;
    for(i=2;i<x;i++)
        {p=prime(i);
         q=prime(x-i);
         if (p+q==x) break;}
    
    cout<<x<<"="<<p<<"+"<<q<<endl;
    
    }

posted on 2013-02-23 16:02  叶城宇  阅读(190)  评论(0编辑  收藏  举报