diff --git a/cv8/a.out b/cv8/a.out index b540158..ae443f1 100755 Binary files a/cv8/a.out and b/cv8/a.out differ diff --git a/cv8/program.c b/cv8/program.c index 96b5759..474e910 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -20,8 +20,16 @@ int main(){ struct tree* root = NULL; root = read_tree(); - getchar(); - + char resp[SIZE]; + memset(resp,0,SIZE); + get_input(resp); + if(strlen(resp)>1){ + puts("Expert z bufetu to vie."); + puts("Chybna databaza"); + exit(0); + } + + puts("Expert z bufetu to vie."); printf("Pozna %d druhov ovocia a zeleniny.\n",type_count(root)); puts("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost."); @@ -90,10 +98,6 @@ void system_execute(struct tree* root){ system_execute(root->left); }else if(resp[0]=='n'){ system_execute(root->right); - }else if(strlen(resp)>1){ - puts("Expert z bufetu to vie."); - puts("Chybna databaza"); - exit(0); }else{ puts("Nerozumiem"); exit(0);