unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls;
type
TForm1 =
class(TForm)
Home: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
PageControl1: TPageControl;
TabSheet4: TTabSheet;
TabSheet5: TTabSheet;
PageControl2: TPageControl;
TabSheet6: TTabSheet;
TabSheet7: TTabSheet;
Label1: TLabel;
Button1: TButton;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Button2: TButton;
Button3: TButton;
Button4: TButton;
Button5: TButton;
Label4: TLabel;
Edit2: TEdit;
Label5: TLabel;
Edit3: TEdit;
Label6: TLabel;
Edit4: TEdit;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label17: TLabel;
Label18: TLabel;
Button6: TButton;
Button7: TButton;
Button8: TButton;
Button9: TButton;
Button10: TButton;
Button11: TButton;
Button12: TButton;
Button13: TButton;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
Label23: TLabel;
zufall: TListBox;
zufall1: TListBox;
zufall3: TListBox;
zufall2: TListBox;
Button14: TButton;
Button15: TButton;
Button16: TButton;
Button17: TButton;
sortiert: TListBox;
Label24: TLabel;
Label25: TLabel;
Label26: TLabel;
Label27: TLabel;
Label28: TLabel;
ListBox2: TListBox;
Label29: TLabel;
Label30: TLabel;
ListBox3: TListBox;
Label31: TLabel;
Label32: TLabel;
ListBox4: TListBox;
Label33: TLabel;
Edit5: TEdit;
Label34: TLabel;
Label35: TLabel;
Label36: TLabel;
Label37: TLabel;
Edit6: TEdit;
Label38: TLabel;
Label39: TLabel;
Label40: TLabel;
Edit7: TEdit;
Label41: TLabel;
Label42: TLabel;
Label43: TLabel;
Edit8: TEdit;
Label44: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button6Click(Sender: TObject);
procedure Button9Click(Sender: TObject);
procedure Button11Click(Sender: TObject);
procedure Button13Click(Sender: TObject);
procedure Button17Click(Sender: TObject);
procedure Button16Click(Sender: TObject);
procedure Button7Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Button6Click(Sender: TObject);
var z,a,i:integer;
begin
randomize;
a:=strtoint(edit1.Text);
for i:=1
to a
do
begin
z:=random(100);
zufall.Items.Add(inttostr(z));
end;
end;
procedure TForm1.Button9Click(Sender: TObject);
var z,a,i:integer;
begin
randomize;
a:=strtoint(edit2.Text);
for i:=1
to a
do
begin
z:=random(100);
zufall1.Items.Add(inttostr(z));
end;
end;
procedure TForm1.Button11Click(Sender: TObject);
var z,a,i:integer;
begin
randomize;
a:=strtoint(edit3.Text);
for i:=1
to a
do
begin
z:=random(100);
zufall2.Items.Add(inttostr(z));
end;
end;
procedure zufall(n:integer;
var z:integer);
var i:integer;
begin
randomize;
z:=random(100);
end;
procedure TForm1.Button13Click(Sender: TObject);
var z,n,i:integer;
begin
n:=strtoint(edit1.Text);
for i:=1
to n
do
begin
zufall.Items.Add(inttostr(z));
end;
end;
procedure TForm1.Button17Click(Sender: TObject);
begin
zufall.Items.Clear;
edit1.Text:='
';
sortiert.Items.Clear;
end;
procedure TForm1.Button16Click(Sender: TObject);
begin
zufall1.Items.Clear;
edit2.Text:='
';
end;
procedure minimumsuche(n:integer;
var h:
array of integer);
var i,j,min,hilfsvar:integer;
begin
for i:=1
to n-1
do
begin
min:=1;
for j:=i+1
to n
do
if h[j]<min
then min:=j;
hilfsvar:=h[min];
h[min]:=h[i];
h[i]:=hilfsvar;
end;
end;
procedure TForm1.Button7Click(Sender: TObject);
{"sortieren"-Button}
var n,i:integer;
h:
array[0..10000]
of integer;
begin
n:=strtoint(edit1.Text);
minimumsuche(n,h);
for i:=1
to n
do
begin
sortiert.Items.Add(inttostr(h[i]));
end;
end;
end.