This commit is contained in:
Oleksandr Hryshchenko 2021-11-26 00:54:02 +00:00
parent f9f0c39dec
commit 64fa62b6ea

View File

@ -47,9 +47,6 @@ struct binary* itemAppend(struct binary* myTree, char* item){
if(!myTree || ((myTree->right != NULL && myTree->left != NULL) && (myTree->left->value[0] == '*' && myTree->right->value[0] == '*'))) if(!myTree || ((myTree->right != NULL && myTree->left != NULL) && (myTree->left->value[0] == '*' && myTree->right->value[0] == '*')))
return NULL; return NULL;
if(!strcmp(item, "Je to zelene?"))
printf("ti");
struct binary* itrNode = myTree; struct binary* itrNode = myTree;
while(itrNode->left != NULL){ while(itrNode->left != NULL){
if(itrNode->left->value[0] != '*') if(itrNode->left->value[0] != '*')
@ -100,14 +97,15 @@ int main() {
if(usrIn[0] == '*') if(usrIn[0] == '*')
inputsAmount++; inputsAmount++;
if(strlen(usrIn) > 1) if(strlen(usrIn) > 1)
itemAppend(itrNode, usrIn); if(!itemAppend(itrNode, usrIn))
inputsAmount = -200;
endingFound = false; endingFound = false;
} }
} }
printf("Expert z bufetu to vie.\n"); printf("Expert z bufetu to vie.\n");
if(inputsAmount == 0){ if(inputsAmount <= 0){
printf("Chybna databaza\n"); printf("Chybna databaza\n");
return 0; return 0;
} }