From 3d40f833d61ba468a2d20cf2a828dc12e2c553dc Mon Sep 17 00:00:00 2001 From: Kozar Date: Sun, 10 Nov 2024 16:23:37 +0000 Subject: [PATCH] Initializacia --- cv7/program.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 4521557..5f06f21 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -54,11 +54,16 @@ void run_tree(struct tree* tree) { if (scanf(" %c", &response) != 1) { printf("Koniec vstupu\n"); return; - } else if (response != 'a' && response != 'n'){ - printf("Nerozumiem\n"); + }else if (response != 'a' && response != 'n') { + if (feof(stdin)) { + printf("Chybna databaza\n"); + } else { + printf("Nerozumiem\n"); + } return; } + if (response == 'a') { run_tree(tree->left); } else {