diff --git a/cv8/program.c b/cv8/program.c index f161177..5f55f07 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -46,19 +46,19 @@ struct tree* search(struct tree* this){ memcpy(buffer, this->value, 50); */ if(this->left != NULL && this->right != NULL){ if(c == 'a'){ - printf("%s\n", this->value); + printf("%s\n", this->left); this->left = search(this->left); } else if(c == 'n'){ - printf("%s\n", this->value); + printf("%s\n", this->right); this->right = search(this->right); } } else { - printf("%s\n", this->value); + //printf("%s\n", this->value); printf("Koniec\n"); - exit(0); + return NULL; } } @@ -110,7 +110,7 @@ int main(){ printf("Expert z bufetu to vie.\n"); printf("Pozna %d druhov ovocia a zeleniny.\n", count); printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n"); - + printf("%s\n", tree->value); tree = search(tree); destroy_tree(tree); return 0;