(* DISTANCES IN A DIGRAPH *) PROGRAM CDISTANC (INPUT,OUTPUT) ; TYPE GYORETSU=ARRAY[ 1..10,1..10 ] OF INTEGER ; VAR D,W : GYORETSU ; N,I,J : INTEGER ; {EXTERNAL PROCEDURE DISTANC (N:INTEGER ; W:GYORETSU ; VAR D:GYORETSU) ;} {$I B:DISTANC.SRC} BEGIN (*CDISTANC*) READ (N) ; FOR I:=1 TO N DO BEGIN READLN ; FOR J:=1 TO N DO READ (W[I,J]) END ; DISTANC (N,W,D) ; WRITELN (LST); WRITELN (LST,'W':1) ; FOR I:=1 TO N DO BEGIN FOR J:=1 TO N DO IF W[I,J]=100 THEN WRITE (LST,'*':3) ELSE WRITE (LST,W[I,J]:3) ; WRITELN (LST) END ; WRITELN (LST); WRITELN (LST,'D : DIJ = THE DISTANCE FROM VI TO VJ':36) ; FOR I:=1 TO N DO BEGIN FOR J:=1 TO N DO IF D[I,J]=100 THEN WRITE (LST,'*':3) ELSE WRITE (LST,D[I,J]:3) ; WRITELN (LST) END END.