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

为什么会Runtime error??大牛们看看。走过路过千万不要错过!!!

Posted by xiaobai1 at 2008-02-17 15:10:21 on Problem 1458
var
  c:array [0..1000,0..1000] of longint;
  n,i,j,k,l:longint;
  a,b,s:ansistring;

begin
  while not eof do
    begin
      fillchar(c,sizeof(c),0);
      readln(s);n:=1;
      while s[n]<>' ' do inc(n);
      a:=copy(s,1,n-1);
      while s[n]=' ' do inc(n);
      b:=copy(s,n,length(s));
      k:=length(a);l:=length(b);
      for i:=0 to k do c[i][0]:=0;
      for j:=0 to l do c[0][j]:=0;
      for i:=1 to k do
      for j:=1 to l do
      if a[i-1]=b[j-1] then c[i][j]:=c[i-1][j-1]+1 else
        if c[i][j-1]>c[i-1][j] then c[i][j]:=c[i][j-1]
                               else c[i][j]:=c[i-1][j];
      writeln(c[k][l]);
    end;
end.

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