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