From 838aabd23830835c4cbf8d6bce5db176636a74d6 Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Sat, 9 Jan 2021 16:40:27 -0500 Subject: Update task7.cpp --- Sem. 14/task7.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Sem. 14/task7.cpp') 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; } -- cgit v1.3.1-23-gd82d