| ||||||||||
| 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 | |||||||||
大家帮帮我看一下代码(pascal)找错var i,i1,j:longint;
s,s1,s2:string;
bj,bj1,bj2:longint;
a:array[1..300] of string;
procedure back;
begin
if i-1<=0 then writeln('Ignored')
else
begin
dec(i);
writeln(a[i]);
end;
end;
procedure forword;
begin
if i+1>=j then writeln('Ignored')
else
begin
inc(i);
writeln(a[i]);
end;
end;
begin
readln(s);
i:=1;
j:=1;
fillchar(a,sizeof(a),' ');
a[1]:='http://www.acm.org/';
while s<>'QUIT' do
begin
s1:='';
s2:='';
bj:=0;
if s='BACK' then back;
if s='FORWARD' then forword;
bj:=pos(' ',s);
if bj<>0 then
begin
s1:=copy(s,1,bj-1);
delete(s,1,bj-1);
if s1='VISIT' then
begin
for i1:=1 to length(s) do if s[i1]<>' ' then begin bj:=i1; break; end;
s2:=copy(s,bj,length(s));
inc(i);
a[i]:=s2;
inc(j);
writeln(a[i]);
end;
end;
readln(s);
end;
end.
就是worry!!!
大家看看
谢谢
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator