From 499b7982d2af5f743cdb35af7f77451875f5fe8a Mon Sep 17 00:00:00 2001 From: Marat Izmailov Date: Thu, 14 Nov 2024 21:13:00 +0000 Subject: [PATCH] Update cv7/program.c --- cv7/program.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 47b5fc8..9100b11 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -57,13 +57,13 @@ void spusti_expert_system(struct strom* uzol) { char odpoved; if (scanf(" %c", &odpoved) != 1 || (odpoved != 'a' && odpoved != 'n')) { printf("Nerozumiem\n"); - return; - } - - if (odpoved == 'a') { - spusti_expert_system(uzol->ano); + spusti_expert_system(uzol); // Повторный вызов для текущего вопроса при некорректном ответе } else { - spusti_expert_system(uzol->nie); + if (odpoved == 'a') { + spusti_expert_system(uzol->ano); + } else { + spusti_expert_system(uzol->nie); + } } } @@ -92,4 +92,4 @@ int main() { znic_strom(databaza_znalosti); return 0; -} +}