| ||||||||||
| 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 | |||||||||
为什么会Runtime error??大牛们看看。走过路过千万不要错过!!!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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator