4. commit

This commit is contained in:
Valér Jakubčo 2021-11-26 03:00:27 +01:00
parent decdc9f4c3
commit 2e3c820cc9

View File

@ -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{