TYPE nodeptr=^nodetype;
nodetype=RECORD
data: intrger; link: nodeptr
END;
VAR n
FUNCTION Create_link_list(n: integer): nodeptr;
VAR head
BEGIN head := NIL;
IF n>
BEGIN new(head); p: =head;
FOR i:=
BEGIN p^
p^
END;
Creat_link_list:=head
END;
PROCEDURE josephus(n
VAR p
BEGIN p:=Creat_link_list(n);
WHILE i>
(D) ;
WHILE j<n DO
BEGIN
FOR i:=
(E) ; write(q^
dispose(q); j:=j+
END
END;【復旦大學
[
From:http://tw.wingwit.com/Article/program/sjjg/201311/22562.html