diff --git a/du1/program.c b/du1/program.c index 58a5474..91b50f0 100644 --- a/du1/program.c +++ b/du1/program.c @@ -1,5 +1,20 @@ #include int main(){ -printf("Hello, world!"); +char word; + + for (int count = 0; (word = getchar()) != EOF;) { + if (word >= 'a'&&word <= 'z') { + word -= 32; + } + else if (word >= 'A'&&word <= 'Z'){ + word += 32; + } + if (word == '\n') { + count++; + printf("\nPočet riadkov: %d\n", count); + } + putchar(word); + + } return 0; }