已知前序后序求中序的一种function ok(

16 查阅
已知前序后序求中序的一种function ok(s1,s2:string):boolean;var i,l:integer; p:boolean;

参考答案:

正确答案:

\r\n

begin
ok:=true;
l:=length(s1);
for i:=1 to l do begin
p:=false;
for j:=1 to l do
if s1[i]=s2[j] then p:=true;
if not p then begin ok:=false;exit;end;
end;
end;

\r\n

procedure solve(pre,post