Const K = 15; Var R:array[1..K] of integer; i,P,O,N:integer; Begin Randomize; P:=0; N:=0; O:=0; For i:= 1 to K do Begin R[i]:=2*random(K)-K; Write(R[i],' '); if R[i] > 0 then P:=P+1 else if R[i] = 0 then N:=N+1 else O:=O+1; End; WriteLn; WriteLn('P = ',P); WriteLn('N = ',N); WriteLn('O = ',O); End.
K = 15;
Var
R:array[1..K] of integer;
i,P,O,N:integer;
Begin
Randomize;
P:=0;
N:=0;
O:=0;
For i:= 1 to K do
Begin
R[i]:=2*random(K)-K;
Write(R[i],' ');
if R[i] > 0 then P:=P+1
else if R[i] = 0 then N:=N+1
else O:=O+1;
End;
WriteLn;
WriteLn('P = ',P);
WriteLn('N = ',N);
WriteLn('O = ',O);
End.