From a3cc4110d273164723aed77f10b9def8bfda7503 Mon Sep 17 00:00:00 2001 From: ak643du Date: Wed, 21 Feb 2024 17:34:55 +0100 Subject: [PATCH] finguje --- pvjc24/cv1/program.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 pvjc24/cv1/program.c diff --git a/pvjc24/cv1/program.c b/pvjc24/cv1/program.c new file mode 100644 index 0000000..882362a --- /dev/null +++ b/pvjc24/cv1/program.c @@ -0,0 +1,28 @@ +#include + +int main(){ + int c; + int line_count = 0; + + while (1){ + c = getchar(); + while( c != EOF){ + if (c >= 'a' && c <= 'z') { + c = c - 'a' + 'A'; // Zmena malého písmena na veľké + } + else if (c >= 'A' && c <= 'Z') { + c = c - 'A' + 'a'; // Zmena veľkého písmena na malé + } + else if (c == '\n') { + line_count++; // Zvýšte počítadlo riadkov na konce riadka + } + else if (c > 31 && c <= 127) { + continue; // Preskočiť značky + } + putchar(c); // Vypíš znak + continue;; + } + printf("\nPocet nacitanych riadkov: %d\n", line_count); + + return 0; +}