home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbopas / pas_sci.arc / SORT-B1.LIB < prev    next >
Text File  |  1985-08-01  |  329b  |  20 lines

  1.  
  2.  
  3. procedure { bubble- } sort(var a: ary; n: integer);  {--> 173}
  4. var    i,j    : integer;
  5.     hold    : real;
  6.  
  7. begin        { procedure sort }
  8.   for i:=1 to n-1 do
  9.     for j:=i+1 to n do
  10.       begin
  11.     if a[i]>a[j] then
  12.       begin
  13.         hold:=a[i];
  14.         a[i]:=a[j];
  15.         a[j]:=hold
  16.       end
  17.     end        { for }
  18. end;        { procedure sort }
  19.  
  20.