#include int main() { int c = 0; int lines_count = 0; int was_newline = 0; while ((c = getchar()) != EOF) { was_newline = 0; if (c >= 'a' && c <= 'z') { c = c - 'a' + 'A'; } else if (c >= 'A' && c <= 'Z') { c = c - 'A' + 'a'; } if (c == '\n') { lines_count++; was_newline = 1; } putchar(c); } if (!was_newline && c != EOF) { putchar('\n'); } printf("Lines count: %d\n", lines_count); return 0; }