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);