Const n=10;
var a:array[1..n] of integer;
k,i:integer;
begin
Randomize;
for i:=1 to n do begin
a[i]:=random(51)-25;
write(a[i],' ');
end;
writeln;
k:=0;
for i:=1 to n do
if a[i]>0 then k:=k+1;
writeln('k = ',k);
end.
Пример:
-17 -20 -21 -15 -12 24 1 0 14 19
k = 4