Int main ()
{
Int m, n, I, j, k;
I=k=0;
Printf (" input string length (m>=n) : ");
The scanf (" % d % d ", & amp; M, & amp; N);
Int t [m], [n] s.
Printf (" input the first string: ");
The scanf (" % s ", t);
Printf (" input another small string: ");
The scanf (" % s ", s);
While (j! M=1)
{
for(j=0; J
The if ()
{
i++;
K++;
If (k==n - 1)
{
Printf (" the position of the substring in a string of t % d to % d ", j - (n - 1), j);
break;
}
}
The else
{
I=0;
k=0;
}
}
}
}
CodePudding user response:
Int t [m], [n] s.//your compiler support with variable declarations array length? If you don't support, to use dynamic array, or m, n with constant lengthCodePudding user response: