Update cv7/program.c

This commit is contained in:
Marat Izmailov 2024-11-11 13:46:59 +00:00
parent 4d80f775bb
commit 310236be4b

View File

@ -72,8 +72,6 @@ Node* parse_rules() {
void ask_question(Node *node) { void ask_question(Node *node) {
if (!node) return; if (!node) return;
if (node->yes == NULL && node->no == NULL) { if (node->yes == NULL && node->no == NULL) {
printf("Expert z bufetu to vie.\n");
printf("Pozna 2 druhov ovocia a zeleniny.\n");
printf("Koniec\n"); printf("Koniec\n");
return; return;
} }
@ -99,6 +97,7 @@ void ask_question(Node *node) {
} }
int main() { int main() {
// General system information only once
printf("Expert z bufetu to vie.\n"); printf("Expert z bufetu to vie.\n");
printf("Pozna 2 druhov ovocia a zeleniny.\n"); printf("Pozna 2 druhov ovocia a zeleniny.\n");
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n"); printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n");
@ -112,6 +111,7 @@ int main() {
int answer_count = count_answers(root); int answer_count = count_answers(root);
printf("Pozna %d druhov ovocia a zeleniny.\n", answer_count); printf("Pozna %d druhov ovocia a zeleniny.\n", answer_count);
// Ask the first question
ask_question(root); ask_question(root);
free_tree(root); free_tree(root);