From 042e637c4f8161a358289c38b2de4e6843a4c5c5 Mon Sep 17 00:00:00 2001 From: Andrii Hermaniuk Date: Fri, 4 Mar 2022 13:59:42 +0100 Subject: [PATCH] add file --- du1/program.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/du1/program.c b/du1/program.c index 8adfc91..e5e60db 100644 --- a/du1/program.c +++ b/du1/program.c @@ -5,14 +5,17 @@ char OutSym; while(1){ - Sym=getchar(); - if(Sym==EOF || Sym==0)break; - else if(Sym<='Z'&&Sym>='A')Sym +=32; - else if(Sym<='z'&&Sym>='a')Sym-=32; - counter++; - OutSym=Sym; - putchar(OutSym); -} + Sym=getchar(); + if(Sym==EOF || Sym==0){ + counter++; + break; + } + else if(Sym<='Z'&&Sym>='A')Sym +=32; + else if(Sym<='z'&&Sym>='a')Sym-=32; + //counter++; + OutSym=Sym; + putchar(OutSym); + } printf("\nPočet riadkov: %d\n",counter); return 0; } \ No newline at end of file