elf465504453 2011-04-25 02:19:00
点我顶贴
收藏
删除
#include<stdio.h>
int main()
{
char A[1000],B[1000];
int i,a,b,ta,tb,cd,max=0,sum;
gets(A);
gets(B);
for(i=0;A[i]!='\0';i++);
for(a=0;a<i;a++)
for(b=0;b<i;b++)if(B[b]==A[a]){
ta=a;
tb=b;
cd=0;
while(B[tb]==A[ta]){
cd+=1;
ta++;
tb++;
if(tb==i)break;
}
if(cd>max){
max=cd;
sum=b;
}
}
for(i=sum;i<=max+sum-1;i++)printf("%c",B[i]);
return 0;
}
状态: Accepted
测评机: Xeost[5]
得分: 100分
提交日期: 2011-4-25 17:18:00
有效耗时: 500毫秒
测试结果1: 通过本测试点|有效耗时78ms
测试结果2: 通过本测试点|有效耗时47ms
测试结果3: 通过本测试点|有效耗时47ms
测试结果4: 通过本测试点|有效耗时47ms
测试结果5: 通过本测试点|有效耗时47ms
测试结果6: 通过本测试点|有效耗时46ms
测试结果7: 通过本测试点|有效耗时47ms
测试结果8: 通过本测试点|有效耗时47ms
测试结果9: 通过本测试点|有效耗时47ms
测试结果10: 通过本测试点|有效耗时47ms