pvjc24/cv1/program.c
2024-02-21 19:39:51 +00:00

24 lines
544 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) || ch==9){
putchar(ch);
}
}
}
printf("\nLines count: %d\n", line_count);
return 0;
}