lab10A

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
program lab10_A1;
var mas: array [1..100] of integer;
i, n, imax: integer;
begin
randomize;
for i := 1 to 20 do begin
mas[i] := random(100) - 50;
end;
imax := mas[1];
for i := 1 to 20 do begin
if imax < mas[i] then begin
imax := mas[i];
end;
end;
n := 0;
for i := 1 to 20 do begin
if imax = mas[i] then begin
n := n + 1;
end;
end;
writeln('max = ', imax, ', n = ', n) ;
end.