比赛 暑假培训B班二测 评测结果 AAAAAAAAAA
题目名称 牛棚回声 最终得分 100
用户昵称 o_o 运行时间 0.002 s
代码语言 Pascal 内存使用 0.17 MiB
提交时间 2012-07-22 11:04:52
显示代码纯文本
var
a,b,c,d,e,r,t,i,j,m,n,o,no,mo:longint;
k:array[0..1000]of longint;
s1,s2:string;
begin
assign(input,'echo.in');
assign(output,'echo.out');
reset(input);
rewrite(output);
readln(s1);
readln(s2);
a:=length(s1);
b:=length(s2);

for i:=1 to b do
if s2[i]=s1[1] then
begin

n:=0;
for j:=1 to a do
if s2[i+j-1]=s1[j] then
n:=n+1;

if no<n then
no:=n;
end;
for i:=1 to a do
if s1[i]=s2[1] then
begin
m:=0;
for j:=1 to b do
if s1[i+j-1]=s2[j] then
m:=m+1;
if mo<m then
mo:=m;
end;
if no>mo then
write(no)
else
write(mo);
close(input);
close(output);
end.