diff options
| author | mo khan <mo.khan@gmail.com> | 2020-06-14 21:36:42 -0600 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-06-14 21:36:42 -0600 |
| commit | a69ec51d000e090fa185f6035864b5f79a5fb98b (patch) | |
| tree | d99089e96b0d1bad6e23d9e5ccf3a100ef815cb9 | |
| parent | 4b411c79466f6b167f04c7eaccb3ca99fcaa8e5e (diff) | |
fix broken test
| -rwxr-xr-x | main | bin | 13724 -> 0 bytes | |||
| -rw-r--r-- | words.c | 10 |
2 files changed, 9 insertions, 1 deletions
| Binary files differ @@ -1,3 +1,11 @@ +#include <string.h> + int split_words(char *sentence) { - return 0; + int i, count = 1; + for (i = 0; i < strlen(sentence); i++) { + if (sentence[i] == ' ') { + count++; + } + } + return count; } |
