From 39fde4afb0eb44dee760b286f1050b819cda168c Mon Sep 17 00:00:00 2001 From: Yurii Yakovenko Date: Mon, 11 Nov 2024 21:49:57 +0000 Subject: [PATCH] Update cv7/program.c --- cv7/program.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/cv7/program.c b/cv7/program.c index 89d85e3..26d32b8 100644 --- a/cv7/program.c +++ b/cv7/program.c @@ -21,23 +21,22 @@ struct tree* read_tree() char buffer[SIZE]; memset(buffer,0,SIZE); char* r = fgets(buffer,SIZE,stdin); - + assert(r); struct tree* node = (struct tree*)calloc(1,sizeof(struct tree)); memcpy(node->value,buffer,SIZE); - - + node->left=NULL; node->right=NULL; if(node->value[0]!='*') { - + node->left=read_tree(node->left); - + node->right=read_tree(node->right); } return node; @@ -67,8 +66,8 @@ int main(void) tr=read_tree(); - printf("\nExpert z bufetu to vie."); - printf("\nPozna 2 druhov ovocia a zeleniny."); + printf("Expert z bufetu to vie.\n"); + printf("Pozna 2 druhov ovocia a zeleniny.\n"); struct tree *p=tr; do @@ -76,7 +75,7 @@ int main(void) printf("%s",p->value); if(p->value[0]=='*') break; - printf("\nOdpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost."); + printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n"); char t=fgetc(stdin); if(t=='a') p=p->left; @@ -89,10 +88,10 @@ int main(void) - + printf("Koniec"); - + return 0; }