home *** CD-ROM | disk | FTP | other *** search
- Reseni ulohy c. 15 (7.12.98)
- ============================
-
- {vlastni algoritmus}
-
- const n = 20;
-
- type index = integer;
- prvek = integer;
- pole = array [1..n] of prvek;
-
- var i, j, k: index;
- x: prvek;
- a: pole;
-
- begin
- for i:=1 to n-1 do
- begin
- k:=i;
- x:=a[i];
- for j:=i+1 to n do
- if a[j]<x then
- begin
- k:=j;
- x:=a[j];
- end;
- a[k]:=a[i];
- a[i]:=x;
- end;
- end.
-
-