From 63ceb32dc77d1c61faa1550a6aedfd2728c02c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1=C5=A1?= Date: Wed, 21 Feb 2024 15:38:23 +0000 Subject: [PATCH] Update 'cv1/program.c' --- cv1/program.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cv1/program.c b/cv1/program.c index 0f3392b..7be80d6 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -5,14 +5,15 @@ int main() { int lines_count = 0; while ((c = getchar()) != EOF) { - + if (c >= 'a' && c <= 'z') { c = c - 'a' + 'A'; } + else if (c >= 'A' && c <= 'Z') { c = c - 'A' + 'a'; } - + if (c == '\n') { lines_count++; } @@ -20,6 +21,10 @@ int main() { putchar(c); } + + if (lines_count > 0) { + putchar('\n'); + } printf("Lines count: %d\n", lines_count); return 0;