program tanulok; uses crt; type tanulo=record nev:string[20]; evf:byte; atl:real; end; var t:array[1..5] of tanulo; i,j:byte; c:char; cs:tanulo; begin for i:=1 to 5 do with t[i] do begin readln(nev); readln(evf); readln(atl) end; clrscr; Gotoxy(10,35); writeln('1. Nev szerint'); writeln('2. Evfolyam szerint'); writeln('3. Atlag szerint'); c:=readkey; case c of '1': for i:=1 to 4 do for j:=1 to 5-i do begin if t[j].nev>t[j+1].nev then begin cs:=t[j]; t[j]:=t[j+1]; t[j+1]:=cs; end; end; '2': for i:=1 to 4 do for j:=1 to 5-i do begin if t[j].evf>t[j+1].evf then begin cs:=t[j]; t[j]:=t[j+1]; t[j+1]:=cs; end; end; '3': for i:=1 to 4 do for j:=1 to 5-i do begin if t[j].atl>t[j+1].atl then begin cs:=t[j]; t[j]:=t[j+1]; t[j+1]:=cs; end; end; end; for i:=1 to 3 do with t[i] do writeln(nev:20,evf:5, atl:8:2); readln end.