This commit is contained in:
Weber 2024-02-21 18:55:50 +00:00
parent 61c826d6b4
commit 9cc5994194

View File

@ -7,15 +7,13 @@ int main() {
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));
putchar('\n');
} else {
putchar((ch >= 'a' && ch <= 'z') ? (ch - 32) : ((ch >= 'A' && ch <= 'Z') ? (ch + 32) : ch));
}
}
if (ch == '\n') {
printf("\nLines count: %d\n", line_count);
line_count = 0;
}
}
return 0;
}