uses crt;
var z: char;
    pole:array[1..10] of integer;
    n,i,docasne:integer;
    plati:boolean;

begin
repeat
clrscr;
writeln('Trtkal 2008 - http://fei.trtkal.net');
writeln('-----------------------------------');
begin
     write('Zadej pocet prvku: ');readln(n);
     randomize;
     for i:=1 to n do
         begin
              pole[i]:=random(51)+50;
              write(pole[i],' ');
         end;
     writeln;
     repeat
           plati:=true;
           for i:=1 to n-1 do
               begin
                    if pole[i]>pole[i+1] then
                       begin
                            docasne:=pole[i];
                            pole[i]:=pole[i+1];
                            pole[i+1]:=docasne;
                            plati:=false;
                       end;
               end;
     until plati=true;
     for i:=1 to n do write(pole[i],' ');
writeln;
end;
writeln('-----------------------------------');
write('Opakovat a/n: ');readln(z);
until (z='n');
end.