Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 14 / task7.cpp
diff options
context:
space:
mode:
1 files changed, 2 insertions, 1 deletions
-rw-r--r--Sem. 14/task7.cpp3
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;
}