11
This commit is contained in:
parent
ad4be0ff41
commit
a1486dbb0d
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user