diff --git a/du6/output/program.exe b/du6/output/program.exe new file mode 100644 index 0000000..093e04a Binary files /dev/null and b/du6/output/program.exe differ diff --git a/du6/program.c b/du6/program.c index c76b4d4..f7527e7 100644 --- a/du6/program.c +++ b/du6/program.c @@ -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() {