Uses crt; const M = 100; var a: array [1..M] of integer; i, max, k, n: integer; begin clrscr; repeat writeln('Введите количество элементов массива'); readln(n); until (n <> 0) and (n>0);
for i := 1 to n do begin writeln('Введите [', i, '] элемент массива'); readln(a[i]); end;
for i := 1 to n do write(' ', a[i]);
writeln;
max := a[1]; for i := 2 to n do if a[i] > max then max := a[i]; writeln(' max= ', max);
for i := 1 to n do if a[i] = max then k := k + 1; writeln(' k= ', k); end.
const M = 100;
var a: array [1..M] of integer;
i, max, k, n: integer;
begin clrscr;
repeat
writeln('Введите количество элементов массива');
readln(n);
until (n <> 0) and (n>0);
for i := 1 to n do
begin
writeln('Введите [', i, '] элемент массива');
readln(a[i]);
end;
for i := 1 to n do
write(' ', a[i]);
writeln;
max := a[1];
for i := 2 to n do
if a[i] > max then max := a[i];
writeln(' max= ', max);
for i := 1 to n do
if a[i] = max then k := k + 1;
writeln(' k= ', k);
end.