include
void main()
{
char s1[] = “a abcdef d”, s2[] = “aaaa abcde dd”, *a, *q, *h, *t;
char *b[100];
int max = 0, k, i;
h = a = s1;
q = s2;
for(; *a != ‘\0’; a++)
{
k = 0;
q = s2;
while(*q != ‘\0’)
{
for(; *q != ‘\0’&& *q != *p; q++)
if(*q != ‘\0’)
b[k++] = q++;
else
b[k] = NULL;
k = 0;
while(b[k] != NULL)
{
for(i = 0; b[k]+i) == (a+i)&&(a+i)!=’\0’; i++)
{
if(i > max)
{
max = i;
h = b[k];
t = b[k]+i+1;
}
}
k++;
}
*t=’\0’;
printf(“%s\n”, h);
}