比赛 暑假培训B班二测 评测结果 AAAAAAAAAA
题目名称 牛棚回声 最终得分 100
用户昵称 李振文 运行时间 0.001 s
代码语言 Pascal 内存使用 0.17 MiB
提交时间 2012-07-22 11:18:31
显示代码纯文本
program a1;
var
s,ss,p,q:string;
i,max:longint;
begin
  assign(input,'echo.in');
  reset(input);
  assign(output,'echo.out');
  rewrite(output);
   readln(s);
   readln(ss);
   for i:=1 to ord(s[0])do
    if i<=ord(ss[0])then
     if (copy(s,1,i)=copy(ss,ord(ss[0])-i+1,i))and(i>max)then max:=i;
   for i:=1 to ord(s[0])do
    if i<=ord(ss[0])then
     if (copy(s,ord(s[0])-i+1,i)=copy(ss,1,i))and(i>max)then max:=i;
   writeln(max);
  close(input);
  close(output);
end.