diff --git a/cv8/program.c b/cv8/program.c index bba71c6..39a25ec 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -55,11 +55,15 @@ void ask(struct node* tree){ printf("%s", tree->data); if(tree->data[0] == '*'){ puts("Koniec"); + return; } - if(tree->left != NULL){ + char buff[SIZE]; + char* r = fgets(buff, SIZE, stdin); + r = fgets(buff, SIZE, stdin); + if(r[0] == 'a' && tree->left != NULL){ tree = tree->left; ask(tree); - }else if(tree->right != NULL) { + }else if(r[0] == 'n' && tree->right != NULL) { tree = tree->right; ask(tree); }else{