Обновить cv7/program.c

This commit is contained in:
Yevhen Kozirovskyi 2024-11-14 20:48:28 +00:00
parent f92d44baf3
commit 382ffe54c1

View File

@ -50,15 +50,15 @@ int count_items(Node *node) {
void ask_question(Node *node) {
if (node == NULL) return;
printf("%s", node->text);
if (node->text[0] == '*') {
printf("Koniec\n");
printf("Expert z bufetu to vie.\n");
return;
}
char answer;
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n");
printf("%s", node->text);
char answer;
if (scanf(" %c", &answer) != 1) {
printf("Neplatny vstup.\n");
return;
@ -86,6 +86,7 @@ int main() {
ask_question(root);
printf("Koniec\n"); // Завершаем программу после вопроса
free_tree(root);
return 0;
}