百度地图setmapstyle:pascal编程哥德巴赫猜想将一个奇数拆分成三个素数之和

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 15:29:46

program l_1(input,output);
var
i,j,k,x:integer;
f:boolean;
function pan(a:integer):integer;
var
i:integer;
begin
pan:=1;
for i:=2 to trunc(sqrt(a)) do
if a mod i=0 then pan:=0;
end;
begin
assign(input,'work1_5.in');
reset(input);
assign(output,'work1_5.out');
rewrite(output);
readln(x);
f:=false;
i:=2;
repeat
for j:=i to (x-i) div 2 do
begin
k:=x-i-j;
writeln(i:2,j:2,k:2);
if pan(i)+pan(k)+pan(j)=3 then
begin
writeln(x,'=',i,'+',j,'+',k);
f:=true;
break;
end;
end;
i:=i+1;
until f=true;
close(input);
close(output);
end.

无法证明
只有有限次的实验

枚举法