Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure Seleсt(var item: DataArray; count:integer);
- var
- i, j, k: integer;
- x: DataItem;
- begin
- for i := 1 to count-1 do
- begin
- k := i;
- x := item[i];
- for j := i+1 to count do { найти элемент с наименьшим
- значением }
- if item[j]<x then
- begin
- k := j;
- x := item[j];
- end;
- item[k] := item[i]; { обмен }
- item[i] := x;
- end;
- end; { конец сортировки выбором }
Advertisement
Add Comment
Please, Sign In to add comment