{$I-} program cminspn3(input,output); {} { } { w K h } { } { u t F v | v } { } { w F P q } { } { w F Q P r r P P T X } { } { w F C w } { } { w w F w w } { } { F MINIMAL SPANNING TREE 3 } { } { g p F o } { } { F P X W T N X } { } {} const maxnode = 9 ; type mat =array[1..maxnode,1..maxnode] of integer; arr = array[1..maxnode,1..maxnode] of integer; edge = record node1,node2,weight:integer; end; var i,j : integer; adjfile,wgtfile :text; adjmat : mat; wgtmat : mat; t : arr; { external procedure minspn3(var adjmat,wgtmat:mat; var t :arr); } {$I B:MINSPN3.SRC} procedure readadj; var i,j :integer; begin assign(adjfile,'B:ADJ'); reset(adjfile); for i:= 1 to maxnode do begin for j := 1 to maxnode do read(adjfile,adjmat[i,j]); readln(adjfile); end; close(adjfile) end; procedure readwgt; var i,j :integer; begin assign(wgtfile,'B:WGT'); reset(wgtfile); for i := 1 to maxnode do begin for j := 1 to maxnode do read(wgtfile,wgtmat[i,j]); readln(wgtfile); end; close(wgtfile) end; begin readadj; readwgt; minspn3(adjmat,wgtmat,t); for i :=1 to maxnode do begin for j := 1 to maxnode do write(lst,t[i,j]:8); writeln(lst) end; end.