
16.06.2010, 23:17
|
 |
Начинающий
|
|
Регистрация: 26.01.2010
Сообщения: 180
Репутация: 31
|
|
Пузырьковой сортировкой
Код:
procedure TForm1.Button1Click(Sender: TObject);
var I,j: integer;
tmp: string;
begin
for j:=0 to listbox1.Items.Count-1 do
for i:=0 to listbox1.Items.Count-2 do
begin
if length(listbox1.Items[i])>length(listbox1.Items[i+1]) then
begin
tmp:=listbox1.Items[i];
listbox1.Items[i]:=listbox1.Items[i+1];
listbox1.Items[i+1]:=tmp;
end;
end;
end;
|