Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

大家帮帮我看一下代码(pascal)找错

Posted by hzh19970714 at 2011-01-29 15:20:00 on Problem 1028 and last updated at 2011-01-29 15:20:23
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator