Home > Back-end >  Bosses have a look at the where there is a problem, why s==[I] t [j] this always run to the else was
Bosses have a look at the where there is a problem, why s==[I] t [j] this always run to the else was

Time:12-18

#include
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 length

CodePudding user response:

reference 1st floor qybao 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 length with constant

I tried a useless ah, or the problem can't compare

CodePudding user response:

S==[I] t [j] where are they?
  • Related