var massive:array[1..100] of integer;
positive, negative, i:integer;
begin
positive:=0; negative:=0;
for i:=1 to 100 do
massive[i] := random(41)-20;
if massive[i] >=0 then positive:=positive+1
else negative:=negative+1;
writeln('Количество положительных позиций: ', positive) ;
write('Количество отрицательных позиций: ', negative);
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var massive:array[1..100] of integer;
positive, negative, i:integer;
begin
positive:=0; negative:=0;
for i:=1 to 100 do
massive[i] := random(41)-20;
for i:=1 to 100 do
if massive[i] >=0 then positive:=positive+1
else negative:=negative+1;
writeln('Количество положительных позиций: ', positive) ;
write('Количество отрицательных позиций: ', negative);
end.