From c46c5efb01b82242826b036433a841f8c28c869f Mon Sep 17 00:00:00 2001 From: Ivan Leichenko Date: Fri, 15 Nov 2024 06:28:57 +0100 Subject: [PATCH] cv7 --- cv7/program.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 5171f62..a31b696 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -92,15 +92,14 @@ void interact(struct tree *node) char answer[SIZE]; while (fgets(answer, SIZE, stdin)) { - answer[strcspn(answer, "\n")] = 0; - - - if (answer[0] == '\0') + if (answer[0] == '\n') { printf("Koniec vstupu\n"); return; } + answer[strcspn(answer, "\n")] = 0; + if (strcmp(answer, "a") == 0) { interact(node->left);