Блог пользователя sai_kiran_n

Автор sai_kiran_n, история, 4 часа назад, По-английски
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

When the length of the string is exactly $$$100$$$, fgets(s, MAX_LEN, stdin); reads only these $$$100$$$ characters and not the '\n' character after the string. Therefore, your code cannot judge the end of the string by checking whether it's '\n'.