diff --git a/cv1/program.c b/cv1/program.c index 0f3392b..7be80d6 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -5,14 +5,15 @@ int main() { int lines_count = 0; while ((c = getchar()) != EOF) { - + if (c >= 'a' && c <= 'z') { c = c - 'a' + 'A'; } + else if (c >= 'A' && c <= 'Z') { c = c - 'A' + 'a'; } - + if (c == '\n') { lines_count++; } @@ -20,6 +21,10 @@ int main() { putchar(c); } + + if (lines_count > 0) { + putchar('\n'); + } printf("Lines count: %d\n", lines_count); return 0;