close
語法:
procedure TForm1.Button1Click(Sender: TObject);
var
m,n,i,j,k:integer;
sum:string;
begin
m:=strtoint(edit1.text);
n:=strtoint(edit2.text);
sum:='';
if m
k:=0;
for i:= m to n do
begin
for j:=2 to i-1 do
begin
if i mod j = 0 then
begin
k:=0;
break;
end
else
begin
k:=1;
continue;
end;
end;
if k=1 then sum:=sum+inttostr(i)+',';
end;
edit3.Text:=sum;
end;
全站熱搜
留言列表