найти количество положительных элементов в массиве А[1..10]
Answers & Comments
Nast30
Program z1; const n=10; var A: array [1..n] of integer; i,k:integer; begin randomize; For i:= 1 to n do begin A[i]:=random (21)-10; write (A[i]:4);end; k:=0; For i:=1 to n do begin If A[i]>0 then k:=k+1;end; Writeln; writeln('k=',k);end.
Answers & Comments
const n=10;
var A: array [1..n] of integer;
i,k:integer;
begin randomize;
For i:= 1 to n do begin
A[i]:=random (21)-10;
write (A[i]:4);end;
k:=0;
For i:=1 to n do
begin
If A[i]>0 then k:=k+1;end;
Writeln;
writeln('k=',k);end.