From 61c826d6b436b12c1964991acfcb34f57e68657e Mon Sep 17 00:00:00 2001 From: Weber Date: Wed, 21 Feb 2024 18:52:45 +0000 Subject: [PATCH] Update 'cv1/program.c' --- cv1/program.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cv1/program.c b/cv1/program.c index 2087be3..0468b22 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -9,13 +9,13 @@ int main() { line_count++; } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { putchar((ch >= 'a' && ch <= 'z') ? (ch - 32) : (ch + 32)); - } else if (ch >= 32 && ch <= 126) { - putchar(ch); + } + + if (ch == '\n') { + printf("\nLines count: %d\n", line_count); + line_count = 0; } } - - putchar('\n'); - printf("Lines count: %d\n", line_count); return 0; } \ No newline at end of file