{$B-} PROGRAM CBICOMPO (INPUT,OUTPUT); {} { } { w } { } { u t F v | v } { } { w F \ q } { } { w F Q O r r P P T R } { } { w F C w } { } { w w F w w } { } { F biconnected component } { } { g p F o } { } { F P X W T N W } { } {} CONST NN=50; STACKMAX=100; TYPE STACK = ARRAY [0..STACKMAX] OF INTEGER; MAT = ARRAY [1..NN,1..NN] OF INTEGER; LIST = ARRAY [1..NN] OF INTEGER; EDGE = ARRAY [1..NN,1..2] OF INTEGER; VAR F :TEXT; N : INTEGER; E : MAT; CLIST : LIST; CEDGE : EDGE; I,J,X : INTEGER; { EXTERNAL PROCEDURE BICOMPO(N : INTEGER ; VAR E : MAT ; VAR CLIST : LIST ; VAR CEDGE : EDGE); } {$I B:BICOMPO.SRC} BEGIN ASSIGN(F,'B:TEDGE'); RESET(F); X:=0; READLN(F,N); FOR I:=1 TO N DO BEGIN FOR J:=1 TO N DO READ(F,E[I,J]); READLN(F) END; BICOMPO(N,E,CLIST,CEDGE); I:=1; WHILE CLIST[I+1]<>0 DO BEGIN X:=X+1; WRITELN(lst,' BICONNECTED COMPONENT No.',X); FOR J:=CLIST[I] TO CLIST[I+1]-1 DO WRITELN(lst,CEDGE[J,1]:8,CEDGE[J,2]:8); I:=I+1 END; CLOSE(F) END.