比赛 |
暑假培训B班二测 |
评测结果 |
AWAAAAAAAA |
题目名称 |
牛棚回声 |
最终得分 |
90 |
用户昵称 |
digital-T |
运行时间 |
0.001 s |
代码语言 |
Pascal |
内存使用 |
0.17 MiB |
提交时间 |
2012-07-22 10:09:51 |
显示代码纯文本
- var
- a,b:string;
- i,j,k,l,big,head,tail:integer;
- begin
- assign(input,'echo.in');reset(input);
- assign(output,'echo.out');rewrite(output);
- readln(a);
- read(b);
- big:=0;
-
- for i:=1 to length(a) do
- for j:=1 to length(b) do
- if a[i]=b[j] then
- begin
- k:=1;
- head:=i;
- tail:=j;
- while (a[head+1]=b[tail+1])and(head<length(a))and(tail<length(b))do
- begin
- inc(k);
- inc(head);
- inc(tail);
- end;
- if (i=1)or(tail=length(b)) then if k>big then big:=k;
- end;
-
- write(big);
-
- close(input);
- close(output);
- end.