diff --git a/du1/program b/du1/program index c6d4661..acc2392 100755 Binary files a/du1/program and b/du1/program differ diff --git a/du1/program.c b/du1/program.c index e69de29..1fadac1 100644 --- a/du1/program.c +++ b/du1/program.c @@ -0,0 +1,23 @@ +#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); + } + printf("\nPočet riadkov: %d\n", count_lines); + return 0; +}