From d82c85bd7d9c8a4284e254a7add1b7724c220dad Mon Sep 17 00:00:00 2001 From: Michal Utlak Date: Wed, 21 Feb 2024 14:07:17 +0100 Subject: [PATCH] skuska --- cv1/program.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/cv1/program.c b/cv1/program.c index 29cab5e..9fb5506 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -1,7 +1,23 @@ -#include +#include -int main(){ +int main() { + int text; - printf("hello world\n"); + while ((text = getchar()) != EOF) { + if (text >= 'a' && text <= 'z') { + text = text - 'a' + 'A'; + } else if (text >= 'A' && text <= 'Z') { + text = text - 'A' + 'a'; + } else if (text == '\n') { + printf("\n"); + continue; + } else if (text < 32 || text == 127) { + continue; + } + putchar(text); + } + + printf("\nPocet riadkov: 1\n"); + return 0; }