#include <stdio.h>#include <string.h>#define N 256intf(constchar*s1,constchar*s2){inta[N][N];intlen1=strlen(s1);intlen2=strlen(s2);inti,j;memset(a,0,sizeof(int)*N*N);intmax=0;for(i=1;i<=len1;i++){for(j=1;j<=len2;j++){if(s1[i-1]==s2[j-1]){a[i][j]=a[i-1][j-1]+1;//填空if(a[i][j]>max)max=a[i][j];}}}returnmax;}intmain(){printf("%d\n",f("abcdkkk","baabcdadabc"));return0;}