Răspuns:
program max_aparitii;
var n,i,num,max,ap:integer;
begin
Write('n='); Read(n);
Writeln('introdu ',n,' numere intregi');
Read(num);
max:=num;
ap:=1;
for i:=2 to n do
begin
Read(num);
if (num>max) then begin max:=num; ap:=1; end
else
begin
if max=num then Inc(ap);
end;
end;
Writeln(max,' ',ap);
end.
Explicație: