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