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

哪错了?求助!为何wa?

Posted by noname00_pas at 2009-05-09 22:06:56 on Problem 1458
var
  a,b,s:string;
  f:array[0..255,0..255]of integer;
  p,i,j:integer;
begin
  repeat
    readln(s);
    p:=pos(' ',s);
    a:=copy(s,1,p-1);
    delete(s,1,p-1);
    while s[1]=' ' do
      delete(s,1,1);
    b:=s;
    fillchar(f,sizeof(f),0);
    for i:=1 to length(a) do
      for j:=1 to length(b) do
        if a[i]=b[j]
          then f[i,j]:=f[i-1,j-1]+1
          else if f[i,j-1]>f[i-1,j]
            then f[i,j]:=f[i,j-1]
            else f[i,j]:=f[i-1,j];
    writeln(f[length(a),length(b)]);
  until eof;
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