вотс...
| Код | program Otlich; uses crt; const n=15; type TStudentInfo=record Surname:string[20]; Rate,Fiz,Mat:integer; end; TStudentsInfo=array[1..n] of TStudentInfo; var SI:TStudentsInfo; count:integer; procedure InputArray(var SI:TStudentsInfo;var count:integer); {ввод инфы} var i,counter:integer; begin writeln('Please enter quantity of students'); repeat readln(counter); if (counter<=0) or (counter>n) then writeln('Invalid data. Please reenter data:'); until (counter>0) and (counter<=n); count:=counter; for i:=1 to counter do begin writeln('Please enter surname:'); readln(SI[i].Surname); writeln('Please enter a rate:'); readln(SI[i].rate); writeln('Please enter ocenku po fizike:'); readln(SI[i].fiz); writeln('Please enter ocenku po matematike:'); readln(SI[i].mat); end; end; procedure PrintArray(var SI:TStudentsInfo;count:integer); {печать инфы} var i:integer; begin for i:=1 to count do begin if (SI[i].Fiz=5) and (SI[i].Mat=5) then TextColor(Red); Writeln('Surname:',SI[i].Surname,'. Rate:',SI[i].rate,'. Fizika=',SI[i].fiz,'. Matematika=',SI[i].mat); NormVideo; end; end; begin InputArray(SI,count); PrintArray(SI,count); readln; end.
| |