Skip to content

Commit 3444da7

Browse files
authored
fix: count newline as the end of a word
1 parent a3682c0 commit 3444da7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

chapter_1/exercise_1_11/word_count_test.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ int main(void)
2323
{
2424
++nl;
2525
}
26-
else if (c == ' ' || c == '\n' || c == '\t')
26+
27+
if (c == ' ' || c == '\n' || c == '\t')
2728
{
2829
state = OUT;
2930
}

0 commit comments

Comments
 (0)