pvjc24/cv1/program.c
2024-02-21 19:25:35 +00:00

24 lines
534 B
C

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