program helyben; const nmax=10; type tomb=array[1..nmax] of integer; var n,db:integer; x:tomb; procedure beolvasas (const n:integer; var x:tomb); var i:integer; begin randomize; for i:=1 to n do begin write (i,'.szam: '); write (random(200)); readln (x[i]); end; end; procedure Szetval (Const n:integer; var db:integer; x:tomb); var seged,e,u:integer; begin seged:=x[1]; e:=1; u:=n; while e0) do u:=u-1; end; If e0) do e:=e+1; if e0 then db:=e else db:=e-1; end; procedure kiiras (const x:tomb); var i:integer; begin writeln ('A szetvalogatott sorozat: '); for i:=1 to n do writeln (x[i]); end; begin writeln ('n= '); readln (n); beolvasas (n, x); szetval (n, db, x); kiiras (x); end.