pvjc22/du1/program.c
Yaroslav Orlianskyi 370b9220af SAD
2022-03-02 14:17:22 +01:00

23 lines
341 B
C

#include <stdio.h>
int main(){
int c = 0;
int counter = 0;
char a;
while(1){
c = getchar();
if(c == '\n')
counter++;
if(c == EOF)
break;
if (c >= 'a' && c <= 'z')
c = c - 'a' + 'A';
else if(c >= 'A' && c <= 'Z')
c = c - 'A' + 'a';
a = c;
putchar(a);
}
printf("\nPočet riadkov: %d\n",counter);
return 0;
}