| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
求助啊!哪位大哥帮我看看是什么问题!谢谢啦!代码附下!#include<stdio.h>
#include<memory.h>
int odd[1000001];
void main()
{
int i,j;
int x,count=0;
memset(odd,1,sizeof(odd));
for(i=2;i<=500000;i++)
{
if(odd[i])
{
for(j=2;j<1000000/i;j++)
odd[i+i*j]=0;
}
}
while(scanf("%d",&x),x)
{
if(x%2!=0||x<=6)
{
printf("Goldbach's conjecture is wrong.\n");
continue;
}
for(i=3;i<=x/2;i+=2)
if(odd[i]&&odd[x-i])
{
printf("%d = %d + %d\n",x,i,x-i);
break;
}
}
}
谢谢!
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator