From 3e416f3804cf60c93e297e6ec8e109e6e46a3fdf Mon Sep 17 00:00:00 2001 From: Maryna Kravtsova Date: Sun, 22 Nov 2020 17:20:06 +0100 Subject: [PATCH] buffet --- cv8/program.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cv8/program.c b/cv8/program.c index cf3bc47..c62f3dc 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -41,15 +41,10 @@ void search(struct tree* this){ memset(buffer,0,5); char* r = fgets(buffer,5,stdin); - if(fgets(buffer, 5, stdin) == NULL){ + if(r == NULL){ printf("Koniec vstupu\n"); exit(0); - } - - /*if(buffer[0] == '\n'){ - char* r = fgets(buffer,5,stdin); - } */ - + } if(buffer[0] == 'a'){ if(this->left->value[0] == '*'){ printf("%s\n", this->left->value); @@ -130,10 +125,10 @@ int count_all(struct tree* node){ int main(){ struct tree* tree = NULL; + printf("Expert z bufetu to vie.\n"); tree = read_tree(); int count = count_leaves(tree); - printf("Expert z bufetu to vie.\n"); printf("Pozna %d druhov ovocia a zeleniny.\n", count); printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n");