diff --git a/cv7/program.c b/cv7/program.c index e8372e8..4fd1d6b 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -55,13 +55,16 @@ void run_expert_system(Node *node) { while (node) { if (!node->yes && !node->no) { // Достигнут конечный узел printf("*%s\n", node->text); + printf("Koniec\n"); return; } + printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n"); printf("%s\n", node->text); char answer; if (scanf(" %c", &answer) != 1) { + printf("Koniec\n"); return; } @@ -70,6 +73,7 @@ void run_expert_system(Node *node) { } else if (answer == 'n') { node = node->no; } else { + printf("Koniec\n"); return; } } @@ -105,6 +109,7 @@ int main() { return 1; } + printf("Expert z bufetu to vie.\n"); int product_count = count_products(root); printf("Pozna %d druhov ovocia a zeleniny.\n", product_count);