uses crt; type Ttomb = Array [1..7] of Integer; var tomb : Ttomb = (8, 3, 4, 5, 2, 9, 7); i : Integer; procedure osszefesul(var a : Ttomb; p, q, r: Integer); var n1, n2, i, j, k : Integer; bal, jobb : Ttomb; begin n1 := q-p+1; n2 := r-q; for i := 1 to n1 do bal[i] := a[p+i-1]; for j := 1 to n2 do jobb[j] := a[q+j]; bal[n1+1] := 10; {Őrszem} jobb[n2+1] := 10; {Őrszem} i := 1; j := 1; for k := p to r do if bal[i]<=jobb[j] then begin a[k] := bal[i]; inc(i); end else begin a[k] := jobb[j]; inc(j); end; end; procedure osszefesulorendezes(var a: Ttomb; p,r:Integer); var q : Integer; begin if p