This commit is contained in:
Deinerovych 2024-11-06 10:22:29 +01:00
parent ad4be0ff41
commit a1486dbb0d

View File

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