PROCEDURE p(w
BEGIN
IF w>
BEGIN
p(w
writeln(w);{輸出W}
p(w
END
END
PROC algo(VAR S : stack; k:integer);
VAR T: stack; temp: integer;
WHILE NOT empty(S) DO
[temp:=POP(S); IF temp<>k THEN PUSH(T
WHILE NOT empty(T) DO [temp:=POP(T);PUSH(S
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/23235.html