Program MinMax var a: array [1..100] of real var i, nmin, nmax: integer, min, max: real BEGIN for i := 1 to 100 do read a[i]; // вводим массив min := a[1]; max := a[1]; nmin := 0; nmax := 0; for i := 1 to 100 do begin if a[i] = min then nmin := nmin + 1; if a[i] = max then nmax := nmax + 1; if a[i] < min then begin min = a[i]; nmin := 1; end if a[i] > max then begin max = a[i]; nmax := 1; end end; if nmin > nmax then write ('Min') if nmin < nmax then write ('Max') if nmin = nmax then write ('Ravno') END.
var a: array [1..100] of real
var i, nmin, nmax: integer, min, max: real
BEGIN
for i := 1 to 100 do read a[i]; // вводим массив
min := a[1]; max := a[1]; nmin := 0; nmax := 0;
for i := 1 to 100 do
begin
if a[i] = min then nmin := nmin + 1;
if a[i] = max then nmax := nmax + 1;
if a[i] < min then begin min = a[i]; nmin := 1; end
if a[i] > max then begin max = a[i]; nmax := 1; end
end;
if nmin > nmax then write ('Min')
if nmin < nmax then write ('Max')
if nmin = nmax then write ('Ravno')
END.