diff --git a/cv1/program.c b/cv1/program.c index 9b80a82..b82efe2 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -1,5 +1,4 @@ #include -#define TAB_WIDTH 7 int main() { int text; @@ -9,21 +8,19 @@ int main() { if (text == '\n') { lines_count++; } else if (text == '\t') { - for (int i = 0; i < TAB_WIDTH; i++) { - putchar(' '); - } + putchar('\t'); continue; } else if (text >= 'a' && text <= 'z') { - text = text - 'a' + 'A'; + putchar(text - 'a' + 'A'); } else if (text >= 'A' && text <= 'Z') { - text = text - 'A' + 'a'; + putchar(text - 'A' + 'a'); } else if (text < 32 || text == 127) { continue; + } else { + putchar(text); } - - putchar(text); } printf("\nLines count: %d\n", lines_count); return 0; -} +} \ No newline at end of file