火车进站吧 关注:16贴子:144
  • 0回复贴,共1
#include <stdio.h>
#include <string.h>
void main()
{
int input,i,j,flag,k=0,output=0;
int sushu[2000];
scanf_s("%d",&input);
for (i = 1; i < input; i++)
{
for (j = 2, flag = 0; j <= i / 2; j++)
{
if (i%j == 0)
{
flag = 1;
break;
}
}
if (flag == 0)
{
sushu[k++]=i;
}
}
for (i = 0; i < k-1; i++)
{
for (j = i + 1; j < k; j++)
{
if (sushu[i] + sushu[j] == input)
{
output = 1;
break;
}
}
if (output == 1)
break;
}
printf("%d",output);
}


IP属地:广东1楼2014-07-03 14:32回复