pvjc24/cv1/program.c
2024-02-21 18:50:25 +00:00

21 lines
477 B
C

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