| 比赛 | 暑假培训B班二测 | 评测结果 | AWAAAAAWAA | 
    | 题目名称 | 牛棚回声 | 最终得分 | 80 | 
    | 用户昵称 | 英雄寞乌云然 | 运行时间 | 0.002 s | 
    | 代码语言 | Pascal | 内存使用 | 0.17 MiB | 
    | 提交时间 | 2012-07-22 10:58:50 | 
显示代码纯文本
program fl;
var
r,z:array[1..1000] of char;
t:array[1..1000] of longint;
a,b,c,d,m,n,i,j,k,h,cd,zd,o,p:longint;
ss,s2,s,ls,zc:string;
u,w:char;
begin
assign(input,'echo.in');
reset(input);
assign(output,'echo.out');
rewrite(output);
read(s); readln;
read(s2);
 i:=length(s); j:=length(s2);
 for a:=1 to i do r[a]:=s[a];
 for a:=1 to j do z[a]:=s2[a];
{===========================================================}
 for a:=1 to i do
 for b:=1 to j do
   if r[a]=z[b] then
   begin
   k:=a; h:=b;
   repeat
    begin
    ss:=ss+z[h];  cd:=cd+1;
    k:=k+1; h:=h+1;
    end;
   until r[k]<>z[h];
    if cd>zd then zd:=cd;
   ss:=ls; cd:=0;
   end;
{===========================================================}
 write(zd);
close(input);
close(output);
end.