哥德巴赫1+1猜想(Goldbach’s Conjecture)var i,j,k,n :integer; p,p1,p2 :boolean;begin i:= ① ; n:=0; while i<=100 do begin j:=3; p:=true; while (i-j>=3)and p do begin p1:=true; for k:=2 to
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/06 12:29:51
哥德巴赫1+1猜想(Goldbach’s Conjecture)var i,j,k,n :integer; p,p1,p2 :boolean;begin i:= ① ; n:=0; while i<=100 do begin j:=3; p:=true; while (i-j>=3)and p do begin p1:=true; for k:=2 to
哥德巴赫1+1猜想(Goldbach’s Conjecture)
var
i,j,k,n :integer;
p,p1,p2 :boolean;
begin
i:= ① ; n:=0;
while i<=100 do
begin
j:=3;
p:=true;
while (i-j>=3)and p do
begin
p1:=true;
for k:=2 to j-1 do
if j mod k=0 then p1:= ② ;
if p1 then
begin
p2:=true;
for k:=2 to i-j-1 do
if (i-j)mod k=0 then p2:= ③ ;
if ④ then
begin
p:=false;
n:=n+1;
write(i:2,'=',j:2,'+',i-j:2,' ':4);
if ⑤ =0 then writeln
end
else j:=j+2
end
else j:=j+2
end;
i:= ⑥
end;
end.
哥德巴赫1+1猜想(Goldbach’s Conjecture)var i,j,k,n :integer; p,p1,p2 :boolean;begin i:= ① ; n:=0; while i<=100 do begin j:=3; p:=true; while (i-j>=3)and p do begin p1:=true; for k:=2 to
完成填空后的程序如下:
var
i,j,k,n :integer;
p,p1,p2 :boolean;
begin
i:=6; n:=0;
while i<=100 do
begin
j:=3;
p:=true;
while (i-j>=3)and p do
begin
p1:=true;
for k:=2 to j-1 do
if j mod k=0 then p1:=false;
if p1 then
begin
p2:=true;
for k:=2 to i-j-1 do
if (i-j)mod k=0 then p2:=false;
if p1 and p2 then
begin
p:=false;
n:=n+1;
write(i:2,'=',j:2,'+',i-j:2,' ':4);
if n mod 5=0 then writeln
end
else j:=j+2
end
else j:=j+2
end;
i:=i+2;
end;
end.