From a2a6b8c0426053776654693c2b989bf130d9357d Mon Sep 17 00:00:00 2001 From: Vladyslav Korzun Date: Fri, 17 Feb 2023 15:03:47 +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 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/du1/program.c b/du1/program.c index 2496083..1b89ce2 100644 --- a/du1/program.c +++ b/du1/program.c @@ -5,6 +5,7 @@ int main(){ int c = 0; int count = 0; int riadok = 0; +int pop = 0; while(c != EOF){ c = getchar(); if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){ @@ -19,16 +20,18 @@ c = tolower(c); printf("%c\n", c); riadok++; } +pop++; +} +if(c == 10){ } else{ -if(c != 10){ +if(pop == 0){ printf("%c\n", c); riadok++; -} -} +}} count = 0; +pop = 0; } -riadok--; printf("Počet riadkov: %d\n", riadok); return 0; }