masnn 2016-07-10 23:56:20
点我顶贴
收藏
删除
var
t:string;
i,n,m:longint;
a:array[1..100]of string;
begin
i:=1;
n:=1;
m:=1;
a[1]:='http://www.acm.org/';
while true do
begin
readln(t);
if t='QUIT' then
break;
if t='BACK' then
if n=1 then
writeln('Ignored')
else
begin
dec(n);
writeln(a[n]);
end;
if t='FORWARD' then
if n=m then
writeln('Ignored')
else
begin
inc(n);
writeln(a[n]);
end;
if (t[1]='V')and(t[2]='I')and(t[3]='S')and(t[4]='I')and(t[5]='T')then
begin
inc(n);
m:=n;
a[n]:=copy(t,7,length(t)-6);
writeln(a[n]);
end;
end;
end.