unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
var
a,b ,c,d:Integer; flag : Boolean;
begin
c := 0;
d := 0;
for a:= 1 to 100 do
begin
c := a div 2 + 1;
flag := True;
for b:=2 to c do
begin
if a mod b = 0 then
begin
flag := False;
Break;
end;
end;
if flag then
begin
Inc(d);
memo1.Lines.Add(intToStr(a));
end;
end;
end;
end.
4041

被折叠的 条评论
为什么被折叠?



