From 10adb704e4beaca0d3215fc0c4dcc0a89173aceb Mon Sep 17 00:00:00 2001 From: Yurii Yakovenko Date: Mon, 11 Nov 2024 23:11:33 +0000 Subject: [PATCH] Update cv7/program.c --- cv7/program.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 5128db9..0ef60be 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -4,6 +4,7 @@ #include #include + #define SIZE 200 struct tree @@ -80,12 +81,15 @@ void destroy_tree(struct tree* tree){ int main(void) { - struct tree *tr=NULL; + char rrrr[333]; + tr=read_tree(); printf("Expert z bufetu to vie.\n"); - if(tr==NULL) + fgets(rrrr, 333, stdin); + + if(tr==NULL||rrrr[0]!='\n') { printf("Chybna databaza\n"); return 0; @@ -93,8 +97,7 @@ int main(void) int kk; char t; - kk=kkk(tr,0); - + kk=kkk(tr,0); printf("Pozna %d druhov ovocia a zeleniny.\n", kk);