program Sort;
uses
Crt;
Const
Max = 3; {liczba elementow tablicy}
Var
Tablica: Array[1..Max] of integer;{nie wiem jakie liczby chcesz sortowac;}
I: Integer; { zmienna pomocnicza}
Procedure Sortuj(Var X: Array of integer);
var
j,k: integer; {j-liczba przegladan tablicy, k-numer elementu}
temp: integer;
Begin
for j:=0 to (Max-1) do
begin
for k:=0 to (Max-2) do
Begin
if (X[k]>X[k+1]) then
Begin
temp:= X[k];
X[k]:= X[k+1];
X[k+1]:= temp;
End;
End;
end;
End;
begin
WriteLn('Podaj ',Max,'liczb(y): ');
For I:=1 to Max do
Read(Tablica[I]);
Sortuj(Tablica);
Write('Posortowana tablica: ');
For I:=1 to Max do
Write(Tablica[I],', ');
ReadKey;
end.
Sprawdz czy o to Ci chodzilo, powinno dzialac.
Pozdrawiam {hello} --DiCz