9
This commit is contained in:
parent
30bef65beb
commit
c0b7fbdd0a
@ -57,13 +57,16 @@ void run_expert_system(Node *node) {
|
|||||||
printf("%s\n", node->text);
|
printf("%s\n", node->text);
|
||||||
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost: ");
|
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost: ");
|
||||||
char answer;
|
char answer;
|
||||||
scanf(" %c", &answer);
|
if (scanf(" %c", &answer) != 1) {
|
||||||
|
printf("Koniec\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (answer == 'a') {
|
if (answer == 'a') {
|
||||||
node = node->yes;
|
node = node->yes;
|
||||||
} else if (answer == 'n') {
|
} else if (answer == 'n') {
|
||||||
node = node->no;
|
node = node->no;
|
||||||
} else {
|
} else {
|
||||||
printf("Neplatná odpoveď. Koniec.\n");
|
printf("Koniec\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user