From 533848832def595fa5004c2818bacc0ad3127371 Mon Sep 17 00:00:00 2001 From: ct453rn Date: Wed, 21 Feb 2024 15:58:18 +0100 Subject: [PATCH] uloha1 --- cv1/program.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cv1/program.c b/cv1/program.c index 17cef6b..1c8d542 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -5,27 +5,29 @@ 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'; } - + else if (c == '\n') { - + lines_count++; + + putchar('\n'); } putchar(c); } - printf("\nLines Count: %d\n", lines_count); + printf("Lines count: %d\n", lines_count); return 0; }