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 |
哪错了?求助!为何wa?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator