unit Plusteilchen;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
Panel1: TPanel;
Panel2: TPanel;
Button2: TButton;
ListBox1: TListBox;
ListBox2: TListBox;
ListBox3: TListBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
min , max , zz , c ,
cc , b , a:integer;
ergebnis1 , ergebnis2 , ergebnis3:
string;
treffer:Boolean;
begin
min:=StrToInt(edit1.Text);
max:=StrToInt(edit2.Text);
a:=0;
b:=0;
c:=0;
cc:=0;
zz:=0;
for a := min
to max
do
begin
for b := a+1
to max
do
begin
treffer:=false;
zz:=a*a+b*b;
for c:=b+1
to max
do
begin
cc:=c*c;
if cc = zz
then
begin
ergebnis1:=IntToStr(a);
ergebnis2:=IntToStr(b);
ergebnis3:=IntToStr(c);
ListBox1.Items.Add(ergebnis1);
ListBox2.Items.Add(ergebnis2);
ListBox3.Items.Add(ergebnis3);
end
end
end
end
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Form1.Close;
end;
end.