pvjc20/du1/program.c

33 lines
431 B
C

#include <stdio.h>
int main() {
char word;
int i = 0;
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') {
while (word + i == '\n') {
count++;
i++;
}
i = 0;
printf("\n\nPočet riadkov: %d", count);
count = 0;
}
putchar(word);
}
return 0;
}