From 1b365345cc02ffc1d7248b9a09b1b01209a6f32e Mon Sep 17 00:00:00 2001 From: Peter Sabol Date: Thu, 3 Mar 2022 15:02:15 +0000 Subject: [PATCH] Update 'du1/program.c' --- du1/program.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/du1/program.c b/du1/program.c index 94924f9..5212292 100644 --- a/du1/program.c +++ b/du1/program.c @@ -1,25 +1,25 @@ -#include -#include - - -int main(){ - int inp_char; - char out_char; - int count_lines = 0; - while(1){ - inp_char = getchar(); - if(inp_char >= 'A' && inp_char <= 'Z') out_char = inp_char + 32; - else if(inp_char >= 'a' && inp_char <= 'z') out_char = inp_char - 32; - else if(inp_char == EOF) break; - else if(inp_char == '\n') { - count_lines++; - out_char = '\n'; - } - else out_char = inp_char; - putchar(out_char); - } - int counter=0; - counter=count_lines; - printf("\nPocet riadkov: %d\n",counter); - return 0; -} +#include +#include + + +int main(){ + int inp_char; + char out_char; + int count_lines = 0; + while(1){ + inp_char = getchar(); + if(inp_char >= 'A' && inp_char <= 'Z') out_char = inp_char + 32; + else if(inp_char >= 'a' && inp_char <= 'z') out_char = inp_char - 32; + else if(inp_char == EOF) break; + else if(inp_char == '\n') { + count_lines++; + out_char = '\n'; + } + else out_char = inp_char; + putchar(out_char); + } + int counter=0; + counter=count_lines; + printf("\nPočet riadkov: %d\n",counter); + return 0; +}