var
i,b,ch:integer;
a:array[1..100] of string;
s1,s:string;
begin
a[1]:='http://www.acm.org/'; ch:=1;
while s<>'QUIT' do
begin
s1:=s;
readln(s);
if (s[1]='V') and (s1[1]='B') THEN for i:=ch+1 to 100 do delete(a[i],1,length(a[i]));
if s='QUIT' then halt;
if s[1]='V' then begin ch:=ch+1; a[ch]:=copy(s,7,length(s)-6); end;
if s[1]='B' then begin
ch:=ch-1;
if ch=0 then begin b:=1; writeln('Ignored'); ch:=ch+1; end; end;
if s[1]='F' then begin
ch:=ch+1;
if length(a[ch])<1 then begin b:=1; writeln('Ignored'); ch:=ch-1; end; end;
if b=0 then writeln(a[ch]); b:=0;
end;
end.
本人是初学者
开始8过不去 看了相关题解改了后 4又过不去了 最后为什么会输出‘FORWARD’而不是网址呢s1:=s;
if (s[1]='V') and (s1[1]='B') THEN for i:=ch+1 to 100 do delete(a[i],1,length(a[i]));
加了这两步
6666666666666666666666666
6
6
6
6
6
6
6
66
66
6
66
66
6
6
6
6
6
66
6
6
6
6
6