Fixed leaf count

This commit is contained in:
Anton Dolozin 2025-11-09 17:26:09 +01:00
parent f604754f4e
commit 5aa8f2e938

View File

@ -93,6 +93,10 @@ int main(void){
int numOfLeaves = count_leaves(tree);
char answer[SIZE];
printf("Expert z bufetu to vie.\n");
if(!tree){
printf("Chybna databaza\n");
return 0;
}
printf("Pozna %d druhov ovocia a zeleniny.\n", numOfLeaves);
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.");
while(tree){