题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1262
太水了....
#include <cstdio>
#include <cmath>
#include <cstring>
bool isP(int n)
{
if(n == 1)
return false;
int k = sqrt(n);
for(int i = 2; i <= k; ++i)
if(n % i == 0)
return false;
return true;
}
int prime[10005];
void init()
{
memset(prime,0,sizeof prime);
for(int i = 1; i <= 10000; ++i)
if(isP(i))
prime[i] = 1;
}
int main()
{
init();
int m;
while(~scanf("%d",&m))
{
int t = m / 2;
//printf("%d %d",prime[3],prime[3]);
for(int i = t; i >= 0; --i)
if(prime[i] && prime[m - i])
{
printf("%d %d\n",i,m - i);
break;
}
}
return 0;
}