const N = 10;
var
a: array[1..N] of integer;
i, neg: byte;
begin
randomize;
neg := 0;
for i:=1 to N do begin
a[i] := random(100) - 50;
write(a[i]:4);
if a[i] < 0 then
neg := neg + 1
end;
writeln;
writeln('Отрицательных: ', neg);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
const N = 10;
var
a: array[1..N] of integer;
i, neg: byte;
begin
randomize;
neg := 0;
for i:=1 to N do begin
a[i] := random(100) - 50;
write(a[i]:4);
if a[i] < 0 then
neg := neg + 1
end;
writeln;
writeln('Отрицательных: ', neg);
end.