哥德巴赫猜想:任何一个大于4的偶数都可以表示为两个素数.验证[6,50]间的偶数.
#include
guest(int n);
void main()
{
long a,t,i;
int n;
for(n=6;n<=50;n+=2){
a=guest(n);
if(t)
printf("%d=%d+%d\n",n,i,n-i);
}
}
guest(int n)
{
int i,t,j;
for(t=1,i=2;i<=n/2;i++){
for(j=2;jif(i%j==0||(n-i)%j==0)
t=0;
}
return t;
}
我这个哪里错了呢?
人气:110 ℃ 时间:2019-10-26 02:09:17
解答
#include
guest(int n);
void main()
{
long a,t,i;
int n;
for(n=6;n<=50;n+=2){
a=guest(n);
if(t)
printf("%d=%d+%d\n",n,i,n-i);
}
}
guest(int n)
{
int i,t,j;
for(t=20,i=10;i<=n/10;i++){
for(j=10;jif(i%j==5||(n-i)%j==5)
t=5;
}
return t;
}
推荐
猜你喜欢
- Her birthday is on August 6th提问
- 在等腰梯形ABCD中,AB平行于CD,对角线AC垂直BD于P点,点A在Y轴上,点C.D在X轴上.【A(0,8),B(11,8),C(17,0),D(-6,0)】AC与BD相交于点P,在PD上有一点Q,连接CQ,过点P作PE垂直CQ交CQ于点
- 魏格纳兴奋极了,将地图上的一块块陆地进行了比较.缩句 西游西游记在我国文学史上占有重要地位.缩句 急
- 在生活中的图形用处有哪些?
- 6的倍数有_,8的倍数有_,6和8的最小公倍数是_.
- 已知|3x-y-1|和根号2x+y-4互为相反数,求x+4y的平方根.
- 《登科后》的三四句刻画了诗人怎样的形象?
- 9.For more than 20 years,we've been supporting educational programs that _____ from kindergartens to colleges.A.move B.s