Update cv7/program.c

This commit is contained in:
Yurii Yakovenko 2024-11-11 22:28:18 +00:00
parent 8b4c6f2707
commit 63179fb088

View File

@ -4,7 +4,6 @@
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#define SIZE 200 #define SIZE 200
struct tree struct tree
@ -81,21 +80,25 @@ int main(void)
printf("%s",p->value); printf("%s",p->value);
if(p->value[0]=='*') if(p->value[0]=='*')
break; break;
do{
t=fgetc(stdin); t=fgetc(stdin);
if(t=='a') if(t=='a')
{ {
p=p->left; p=p->left; break;
} }
else if(t=='n') else if(t=='n')
{ {
p=p->right; p=p->right; break;
} }
else if(t!='\n') else if(t!='\n')
{ {
printf("Nerozumiem\n"); printf("Nerozumiem\n");
t=44;
break;
} }
}while(1);
}while(1); }while(t!=44);
printf("Koniec\n"); printf("Koniec\n");
destroy_tree(tr); destroy_tree(tr);