From a1486dbb0d1a9384b97682de3cc1b5fb78ba9d79 Mon Sep 17 00:00:00 2001 From: Deinerovych Date: Wed, 6 Nov 2024 10:22:29 +0100 Subject: [PATCH] 11 --- cv7/program.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cv7/program.c b/cv7/program.c index c129d8d..73fb855 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -56,11 +56,13 @@ void run_expert_system(Node *node) { } printf("%s\n", node->text); printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost\n"); + char answer; if (scanf(" %c", &answer) != 1) { printf("Koniec\n"); return; } + if (answer == 'a') { node = node->yes; } else if (answer == 'n') { @@ -72,6 +74,7 @@ void run_expert_system(Node *node) { } } + void free_tree(Node *node) { if (node) { free_tree(node->yes);