diff options
Update task7.cpp
1 files changed, 2 insertions, 1 deletions
| -rw-r--r-- | Sem. 14/task7.cpp | 3 |
diff --git a/Sem. 14/task7.cpp b/Sem. 14/task7.cpp index abe8458..726a0f2 100644 --- a/Sem. 14/task7.cpp +++ b/Sem. 14/task7.cpp @@ -29,7 +29,8 @@ int fillWords(const char* str, char words[MAXLEN][MAXLEN]) currentWordCursorInMatrix++; } } - + if(str[len-1] != ' ') + count++; //the last word; return count; } |
