From 3f2d17ecd76821a8968ab2828a75babd23626a54 Mon Sep 17 00:00:00 2001 From: Deinerovych Date: Fri, 8 Nov 2024 13:43:23 +0100 Subject: [PATCH] hz1 --- cv7/program.c | 5 +++++ 1 file changed, 5 insertions(+) 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);