有效耗时: 1547毫秒
测试结果1: 通过本测试点|有效耗时172ms
测试结果2: 通过本测试点|有效耗时171ms
测试结果3: 通过本测试点|有效耗时172ms
测试结果4: 通过本测试点|有效耗时172ms
测试结果5: 通过本测试点|有效耗时172ms
测试结果6: 通过本测试点|有效耗时172ms
测试结果7: 通过本测试点|有效耗时172ms
测试结果8: 测试结果错误.错误结果为:http://acm.ashland.edu/
http://asm.baylor.edu/acmipc/
http://acm.ashland.edu/
http://www.acm.org/
http://www.funtime.com/jokes
http://asm.baylor.edu/acmipc/
http://www.ibm.com/
http://asm.baylor.edu/acmipc/
http://www.ibm.com/
http://asm.baylor.edu/acmipc/
ftp://goodstuff.mysite.com/more/more/more/theend.html
Ignored
http://asm.baylor.edu/acmipc/
http://www.funtime.com/jokes
正确结果应为:http://acm.ashland.edu/
http://asm.baylor.edu/acmipc/
http://acm.ashland.edu/
http://www.acm.org/
http://www.funtime.com/jokes
Ignored
http://www.ibm.com/
http://www.funtime.com/jokes
http://www.ibm.com/
http://www.funtime.com/jokes
ftp://goodstuff.mysite.com/more/more/more/theend.html
Ignored
http://www.funtime.com/jokes
http://www.acm.org/
测试结果9: 通过本测试点|有效耗时172ms
测试结果10: 通过本测试点|有效耗时172ms
提交代码:
01.var
02.a:array[0..10000] of string;
03.i,j:longint;
04.s:string;
05.begin
06.readln(s);
07.a[1]:='http://www.acm.org/';
08.i:=1;
09.while s<>'QUIT' do
10.begin
11.if s[1]='V' then
12.begin
13.delete(s,1,6);
14.inc(i);
15.a[i]:=s;
16.writeln(a[i]);
17.end else
18.if s='BACK' then
19.begin
20.dec(i);
21.if i=0 then begin writeln('Ignored'); inc(i); end else writeln(a[i]);
22.end else
23.if s='FORWARD' then
24.begin
25.inc(i);
26.if a[i]='' then begin writeln('Ignored'); dec(i) end else writeln(a[i]);
27.end;
28.readln(s);
29.end;
30.end.