Update cv7/program.c
This commit is contained in:
parent
3043acee18
commit
bdb448a1f5
@ -29,6 +29,7 @@ struct tree* read_tree()
|
||||
|
||||
|
||||
|
||||
|
||||
node->left=NULL;
|
||||
node->right=NULL;
|
||||
|
||||
@ -66,7 +67,33 @@ int main(void)
|
||||
|
||||
tr=read_tree();
|
||||
|
||||
print_tree(tr,3);
|
||||
printf("\nExpert z bufetu to vie.");
|
||||
printf("\nPozna 2 druhov ovocia a zeleniny.");
|
||||
|
||||
struct tree *p=tr;
|
||||
do
|
||||
{
|
||||
printf("%s",p->value);
|
||||
if(p->value[0]=='*')
|
||||
break;
|
||||
printf("\nOdpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.");
|
||||
char t=fgetc(stdin);
|
||||
if(t=='a')
|
||||
p=p->left;
|
||||
if(t=='n')
|
||||
p=p->right;
|
||||
|
||||
}while(1);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//print_tree(tr,3);
|
||||
printf("Koniec");
|
||||
|
||||
//printf("%s", tr->value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user