From 0fd6398488b533036ab916b9910a1dcc0af870eb Mon Sep 17 00:00:00 2001 From: Deinerovych Date: Wed, 6 Nov 2024 11:44:04 +0100 Subject: [PATCH] 15 --- cv7/program.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 357d17a..755f4ec 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -69,6 +69,9 @@ void run_expert_system(Node *node) { return; } + // Очищаем оставшиеся символы в буфере после ввода + while (getchar() != '\n'); + // Переход к узлу "да" или "нет" if (answer == 'a') { node = node->yes; @@ -82,9 +85,6 @@ void run_expert_system(Node *node) { } } - - - void free_tree(Node *node) { if (node) { free_tree(node->yes);