From 4ab3e04fd11d9476fac12db5f65cdd0d5a7b8772 Mon Sep 17 00:00:00 2001 From: zlg Date: Fri, 8 Feb 2013 03:51:59 -0600 Subject: Fix Exercise 1-12's solution Printing a newline for each whitespace character was the wrong behavior. --- 1-12_one-word-per-line.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/1-12_one-word-per-line.c b/1-12_one-word-per-line.c index 3f31d1d..29a38df 100644 --- a/1-12_one-word-per-line.c +++ b/1-12_one-word-per-line.c @@ -22,8 +22,10 @@ int main(void) { nl++; } if (c == ' ' || c == '\n' || c == '\t') { - state = OUT; - putchar('\n'); + if (state == IN) { + state = OUT; + putchar('\n'); + } } else if (state == OUT) { state = IN; nw++; -- cgit v1.2.3-70-g09d2 'hidden' name='id' value='cece39677cea9c31e3637092affffd598f6c67b5'/> Manage your game collection and knock out that backlog!zlg
summaryrefslogtreecommitdiff
path: root/scripts (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2025-07-27README.md: update to include mentions of *_date fieldszlg1-7/+26
2025-07-27Finish integrating support for p_date, et alzlg2-23/+59
2025-01-24Add support for p_date, b_date, c_date to CLIzlg2-48/+136
2025-01-24tox.ini: Update to Python 3.11 env by defaultzlg1-1/+1
2025-01-23schema1-to-2.py: Add shebang because I'm a doofuszlg1-0/+2
2023-09-22scripts: Add schema v1->v2 migration scriptzlg2-9/+85