Косте

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
const
N=10;
var
A: array [1..N] of integer;
min, max: integer;
cmin, cmax: byte;
i: byte;
BEGIN
randomize;
min:=32767; max:=-32768;
cmin:=0; cmax:=0;
for i:=1 to N do
begin
A[i]:=random(100)-25;
if (A[i]<min) then
begin
min:=A[i]; cmin:=cmin+1;
end;
if (A[i]>max) then
begin
max:=A[i]; cmax:=cmax+1;
end;
end;
writeln(' Минимумов: ', cmin);
writeln('Максимумов: ', cmax);
END.