diff --git a/cv7/program.c b/cv7/program.c index b18b7b2..72fed70 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -49,10 +49,14 @@ void run_tree(struct tree* tree) { printf("%s\n", tree->value); char response; - if (scanf(" %c", &response) != 1 || (response != 'a' && response != 'n')) { + if (scanf(" %c", &response) != 1) { + printf("Koniec vstupu\n"); + return; + if else(response != 'a' && response != 'n'){ printf("Nerozumiem\n"); return; } + } if (response == 'a') { run_tree(tree->left);