search

Home  >  Q&A  >  body text

c++ - 字符串蛮力匹配问题

伊谢尔伦伊谢尔伦2806 days ago573

reply all(1)I'll reply

  • PHPz

    PHPz2017-04-17 13:03:43

    Writing "m <= j" is irregular and should be written in the form of "m == j".

    is actually written as

    if(m == j) 
        break;

    is also problematic, because only the inner loop is broken, and the outer loop is not broken. The loop continues to execute, and the function does not end.

    can be written as:

    if(m == j)
        return i;

    Anyway, this code is messy. Don’t worry about this code. If you read this kind of code too much, it will affect your programming level.

    reply
    0
  • Cancelreply