Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
我的程序为何过不了?各路高手帮帮忙!!!var temp2,t2,j,t1,t:integer; a,d:array [1..100] of string; b:array [1..100] of integer; c,e:array [1..100] of boolean; procedure init; var ch,ch1:char; i:integer; begin t:=1; a[1]:='http://www.acm.org/'; fillchar(c,sizeof(c),false); c[1]:=true; repeat read(ch); case ch of 'V':begin for i:=1 to 5 do read(ch1); inc(t1); b[t1]:=0; inc(t); read(a[t]); c[t]:=true; end; 'B':begin readln; inc(t1); b[t1]:=-1; end; 'F':begin readln; inc(t1); b[t1]:=1; end; 'Q':begin readln; inc(t1); b[t1]:=2; end; end; until ch='Q'; end; procedure work; var i:integer; begin j:=1; t2:=1; temp2:=1; d[1]:='http://www.acm.org/'; for i:=1 to t1 do begin if b[i]=0 then begin fillchar(e,sizeof(e),true); inc(j); writeln(a[j]); inc(t2); temp2:=t2; d[t2]:=a[j]; c[t2]:=true; e[t2]:=false; end; if b[i]=1 then if (c[temp2+1])and(e[temp2]) then begin inc(temp2); inc(t2); d[t2]:=d[temp2]; writeln(d[t2]); c[t2]:=true; end else writeln('Ignored'); if b[i]=-1 then if c[temp2-1] then begin inc(t2); d[t2]:=d[temp2-1]; temp2:=temp2-1; writeln(d[t2]); c[t2]:=true; end else writeln('Ignored'); if b[i]=2 then halt; end; end; begin init; work; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator