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

19 lines
394 B
C

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