Var a:array[1..10000] of integer;
n,i,max,k:integer;
begin
readln(n);
for i:=1 to n do read(a[i]);
max:=a[1]; k:=1;
for i:=2 to n do
begin
if a[i]>max
then begin max:=a[i]; k:=1; end
else if a[i]=max then k:=k+1;
end;
writeln('k = ',k);
end.
Пример:
6
1 2 3 2 3 3
k = 3