merkator

Untitled

Apr 8th, 2012
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. procedure Seleсt(var item: DataArray; count:integer);
  2. var
  3.          i, j, k: integer;
  4.          x: DataItem;
  5. begin
  6.          for i := 1 to count-1 do
  7.          begin
  8.            k := i;
  9.            x := item[i];
  10.            for j := i+1 to count do { найти элемент с наименьшим
  11.                      значением }
  12.            if item[j]<x then
  13.            begin
  14.                k := j;
  15.                x := item[j];
  16.              end;
  17.            item[k] := item[i];  { обмен }
  18.            item[i] := x;
  19.          end;
  20. end; { конец сортировки выбором  }
Advertisement
Add Comment
Please, Sign In to add comment