Etiketler

,

// ekle butonu
procedure TForm1.Button1Click(Sender: TObject);
begin
  memo1.Lines.Add(edit1.Text);
  edit1.Clear;
end;

// temizle butonu
procedure TForm1.Button2Click(Sender: TObject);
begin
  memo1.Lines.Clear;
end;

//sırala butonu
procedure TForm1.Button3Click(Sender: TObject);
  var
  dizi:array of integer;
  adet,i,j,deger:integer;
begin
  memo2.Lines.Clear;
  adet:=memo1.lines.Count;
  SetLength(dizi,adet);
  for i:=0 to adet-1 do
  dizi[i]:=strtoint(memo1.lines.Strings[i]);
  for i:=0 to adet-1 do
  begin
    for j:=0 to adet-1 do
      begin
        if dizi[i]>dizi[j] then
          begin
          deger:=dizi[j];
          dizi[j]:=dizi[i];
          dizi[i]:=deger;
          end;
      end;
    end;
for i:=0 to adet-1 do
memo2.Lines.Add(inttostr(dizi[i]));
end;

end.
About these ads