pvjc24/cv1/program.c
2024-02-21 14:11:07 +01:00

24 lines
514 B
C

#include <stdio.h>
int main() {
int text;
int lines_count = 0;
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') {
lines_count++;
} else if (text < 32 || text == 127) {
continue;
}
putchar(text);
}
printf("\nLines count: %d\n", lines_count);
return 0;
}