PROGRAM topol_order(input
CONST maxn=
TYPE nodeptr=^nltype ;
nltype=RECORD num : integer ; link : nodeptr END ;
chtype=RECORD count : integer ; head : nodeptr END ;
VAR ch : ARRAY [
PROCEDURE readdata ;
VAR i
BEGIN
write (′input vertex number n= ′); readln (n) ;
write (′input edge number m= ′); readln(m) ;
FOR i:=
writeln(′input edges :′);
FOR j:=
BEGIN write( j :
ch[v]
END ;
PROCEDURE topol ;
VAR i
BEGIN
top:=
FOR i :=
IF ch[i]
i:=
WHILE (
BEGIN (
WHILE t<>NIL DO
BEGIN k := t^
IF ch[k]
(
END ; writeln;
IF i<n THEN writeln (′the network has a cycle!′)
END;
BEGIN
readdata ; writeln (′output topol order : ′); topol
END
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23114.html