From 434e8872a2fa2c4c65989c6ebc290cdffa320a51 Mon Sep 17 00:00:00 2001 From: Miroslav Liptai Date: Thu, 18 Apr 2019 08:16:43 +0000 Subject: [PATCH] =?UTF-8?q?P=C5=99idat=20'main.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 main.c diff --git a/main.c b/main.c new file mode 100644 index 0000000..b024003 --- /dev/null +++ b/main.c @@ -0,0 +1,38 @@ +#include + +int main() +{ + int znak; + char znak2; + int pocet=0; + + while(znak=getchar(),znak!=EOF) + { + if(znak>=97 && znak<=122) + { + znak2=znak-32; + putchar(znak2); + } + + else if(znak>=65 && znak<=90) + { + znak2=znak+32; + putchar(znak2); + } + else if(znak=='\n') + { + pocet++; + printf("\n"); + } + else + { + putchar(znak); + } + + } + printf("Počet riadkov: %d",pocet); + printf("\n"); + + + return 0; +} \ No newline at end of file