Task: There is information about the results of the winter session in the first year. Data on each first-year student is presented in the following form: <Last name>, <number_groups>, <zinc1>, <zinc2>, <zinc3>, where the first grade is for the higher mathematics exam, the second is for programming, the third is for history . Create a program that enters this information and prints the following data: Student rankings by diminishing success
type info = record groupe: string[15]; markMath, markProg, markHist: real; end; ser = record surname: string[15]; seredn: real; end; S = array [1..10] of ser; register= array [1..10] of info; var i,j,n: integer; MAX: real; A: array [1..100] of real; reg : register; sered: S; begin randomize; repeat write('Enter quantity of students: '); readln(n); until n>0; for i:=1 to n do begin with reg[i] do begin with sered[i] do begin write('Enter surname: '); readln(surname); end; write('Enter groupe: '); readln(groupe); for j:=1 to 3 do begin if j=1 then begin markMath:=random(101); writeln('Math: ', markMath); //readln(markMath); end else begin if j=2 then begin markProg:=random(101); writeln('Programming: ', markProg); //readln(markProg); end else begin markHist:=random(101); writeln('History: ', markHist); //readln(markHist); end; end; end; with sered[i] do begin seredn:=(markMath+markProg+markHist)/3; writeln('Average[',i,']= ', sered[i].seredn:6:1); end; end; end; with sered [i] do begin for j:=1 to N-1 do for i:=1 to Nj do if sered[i].seredn < sered[i+1].seredn then begin swap(sered[i].seredn,sered[i+1].seredn); end; end; for i:=1 to n do writeln(sered[i].seredn); for i:=1 to n do begin with sered[i] do writeln(i,' - ',sered[i].seredn,'famil - ', sered[i].surname); end; end. It turned out to sort the average values, but there is a problem: How to sort the last names?