
TYPE
ND=^NODE;
Node=record
INF1:integer;
INF2:string;
LEFT:ND;
RIGHT:ND;
end;
VAR
ROOT,P,Q:ND;
procedure node_count(P:ND; VAR n_count:Integer);
Begin
IF P<>NIL then
begin
IF (P^.LEFT<>NIL) or (P^.RIGHT<>NIL) then
inc(n_count);
node_count(P^.LEFT,n_count);
node_count(P^.RIGHT,n_count);
end;
End;
procedure prt_node_count(n_count);
VAR
n_count:integer;
Begin
n_count:=0;
node_count(ROOT,n_count);
writeln(n_count);
readkey;
End;