分类: C/C++
2013-03-19 18:00:06
绯凉默2015-03-12 08:50:40
#include <stdio.h>
#include <string.h>
int GetCommon(char *s1,char *s2,char *r){
int len1=strlen(s1);
int len2=strlen(s2);
int maxlen=0;
int i,j,k;
for(i=0;i<len1;i++){
for(j=0;j<len2;j++){
if(s1[i]==s2[j]){
int as=i,bs=j,count=1;
while((as+1<len1)&&(bs+1<len2)&&s1[++as]==s2[++bs]){
count++;
&nb