From 0728db4408d3d639af5fdcd9e3a7f6dd6d16846f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Ut=C4=BE=C3=A1k?= Date: Wed, 21 Feb 2024 14:24:42 +0000 Subject: [PATCH] FUNGUJ --- cv1/program.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cv1/program.c b/cv1/program.c index a03143d..d3320d4 100644 --- a/cv1/program.c +++ b/cv1/program.c @@ -5,11 +5,12 @@ int main() { int lines_count = 0; while ((text = getchar()) != EOF) { - if (text == '\t') { - putchar('\t'); - } else if (text == '\n') { + if (text == '\n') { + putchar('\n'); lines_count++; - putchar('\n'); + } else if (text == '\t') { + putchar('\t'); + continue; } else if (text >= 'a' && text <= 'z') { putchar(text - 'a' + 'A'); } else if (text >= 'A' && text <= 'Z') { @@ -21,6 +22,6 @@ int main() { } } - printf("Lines count: %d\n", lines_count); + printf("\nLines count: %d\n", lines_count); return 0; }