program alrendezes4; uses crt; const n=6; m=6; type rec=record nev:string[40]; jegy:byte; end; var oszt:byte; x:array[1..n] of rec; y:array[1..5,1..n] of string; db:array[1..5] of integer; procedure beolvas; var i:integer; begin for i:=1 to n do begin write(i,'. nev:'); readln(x[i].nev); write(i,'. osztalyzat:'); readln(x[i].jegy); end; end; {procedure kivalog; begin dbi:=1 for i:=1 to n do if t1(x[i].jegy) then begin inc (db1); y[dbi]:=x[i]; end; end; for i:=db1+1 to dbi end;} Procedure alrendez; var i:integer; begin For i:=1 to m do begin oszt:=x[i].jegy; db[oszt]:=db[oszt]+1; y[oszt,db[oszt]]:=x[i].nev; end; {begin db[x[i].jegy]:=db[x[i].jegy]+1 y[x[i].jegy,db[x[i].jegy]]:=x[i] end;} {For j:=1 to 5 do If x[i].jegy=j then db[j]:=db[j]+1 and y[j,db[j]]:=x[i] end; end;} end; procedure kiiras; var i,j:integer; begin for i:=1 to 5 do begin for j:=1 to db[i] do begin writeln (' '); write(i); writeln(y[i,j]); writeln (' '); end; end; readln; end; begin beolvas; alrendez; kiiras; end.