diff --git a/cv1/program.c b/cv1/program.c index 59e9290..2087be3 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -7,13 +7,15 @@ int main() { while ((ch = getchar()) != EOF) { if (ch == '\n') { line_count++; - } else { - putchar((ch >= 'a' && ch <= 'z') ? (ch - 32) : ((ch >= 'A' && ch <= 'Z') ? (ch + 32) : (ch >= 32 && ch <= 126 ? ch : '\0'))); + } 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("\nLines count: %d\n", line_count); + printf("Lines count: %d\n", line_count); return 0; } \ No newline at end of file