From 3502265db71ec2b3d3ed344debee328c0660b8a3 Mon Sep 17 00:00:00 2001 From: Pavlo Tverdyi Date: Sun, 1 Mar 2020 13:33:27 +0100 Subject: [PATCH] funguje --- du1/program.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/du1/program.c b/du1/program.c index c9ad0b2..f0db2b7 100644 --- a/du1/program.c +++ b/du1/program.c @@ -8,22 +8,19 @@ int main() int riad=0; while(1){ simb=getchar(); - if(islower(simb)){ - simb-=32; - } - else if (isupper(simb)){ - simb+=32; - } - else if(simb==EOF){ - break; - } + if(islower(simb)){ + simb-=32; + } + else if (isupper(simb)){ + simb+=32; + } + else if(simb==EOF){ + break; + } + if(simb=='\n'){ + riad++; + } putchar(simb); - if(simb=='\n'){ - riad++; - } - if(simb=='\n'){ - riad++; - } } printf("\nPočet riadkov: %d\n",riad); return 0;