pvjc24/cv1/program.c
2024-02-21 14:21:26 +00:00

27 lines
629 B
C

#include <stdio.h>
int main() {
int text;
int lines_count = 0;
while ((text = getchar()) != EOF) {
if (text == '\t') {
putchar('\t');
} else if (text == '\n') {
lines_count++;
putchar('\n');
} else if (text >= 'a' && text <= 'z') {
putchar(text - 'a' + 'A');
} else if (text >= 'A' && text <= 'Z') {
putchar(text - 'A' + 'a');
} else if (text < 32 || text == 127) {
continue;
} else {
putchar(text);
}
}
printf("Lines count: %d\n", lines_count);
return 0;
}