From 454fa49d1c164b3269d5f83a006e4016e9adfae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Ut=C4=BE=C3=A1k?= Date: Wed, 21 Feb 2024 13:24:35 +0000 Subject: [PATCH] Update 'cv1/program.c' --- cv1/program.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cv1/program.c b/cv1/program.c index 137c79e..1e8d2d8 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -1,5 +1,7 @@ #include +#define TAB_WIDTH 4 + int main() { int text; int lines_count = 0; @@ -11,6 +13,11 @@ int main() { text = text - 'A' + 'a'; } else if (text == '\n') { lines_count++; + } else if (text == '\t') { + for (int i = 0; i < TAB_WIDTH; i++) { + putchar(' '); + } + continue; } else if (text < 32 || text == 127) { continue; } @@ -20,4 +27,4 @@ int main() { printf("\nLines count: %d\n", lines_count); return 0; -} +} \ No newline at end of file