This commit is contained in:
Oleksandr Vyshniakov 2025-11-20 16:37:00 +01:00
parent 07d5261362
commit 56f932a1e5
2 changed files with 9 additions and 6 deletions

BIN
du6/output/program.exe Normal file

Binary file not shown.

View File

@ -91,21 +91,24 @@ static void run_dialog(TreeNode *root) {
}
char c = 0;
if (scanf(" %c", &c) != 1) {
printf("Odpovedajte 'a' alebo 'n'\n");
int r = scanf(" %c", &c);
if (r != 1) {
printf("Koniec vstupu\n");
return;
}
if (c == 'a') {
run_dialog(root->yes_branch);
return;
}
else if (c == 'n') {
if (c == 'n') {
run_dialog(root->no_branch);
return;
}
else {
printf("Nerozumiem\n");
return;
}
}
int main() {