From 09f6241de283c9f7f430b4b3f77fc786b30ba5b3 Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Fri, 17 Feb 2023 11:26:43 +0000 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'du1/program.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- du1/program.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/du1/program.c b/du1/program.c index f648987..39a8437 100644 --- a/du1/program.c +++ b/du1/program.c @@ -5,27 +5,39 @@ int main(){ int count = 0; int c = 0; int riadok = 0; +int pop = 0; while(c != EOF){ c = getchar(); count = 0; - if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){ +//printf("%d\n", c); +if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){ if (c >= 'a' && c <= 'z'){ c = c - 32; printf("%c\n", c); count = 1; riadok++; +pop++; } if (c >= 'A' && c <= 'Z' && count == 0){ c = c + 32; printf("%c\n", c); riadok++; +pop++; } } -/*else{ +else{ +if(c != 10){ +printf("%c\n", c); +riadok++; +} +} +/*if(pop == 0){ +printf("%d", c); riadok++; }*/ +pop = 0; count = 0; } printf("\nPočet riadkov: %d\n", riadok); return 0; -} +} \ No newline at end of file