diff --git a/cv8/program.c b/cv8/program.c index c935fa4..53b4753 100644 --- a/cv8/program.c +++ b/cv8/program.c @@ -3,7 +3,6 @@ #include #include - #define SIZE 256 struct tree { @@ -12,7 +11,6 @@ struct tree { struct tree* right; }; - struct tree* read_tree(int* counter); void destroy_tree(struct tree* tree); void print_tree(struct tree* tree, int offset); @@ -43,14 +41,14 @@ struct tree* read_tree(int* counter) { void destroy_tree(struct tree* tree) { if (tree) { destroy_tree(tree->left); - destroy_tree(tree->right); + destroy_tree(tree->right); free(tree); } } void print_tree(struct tree* tree, int offset) { for (int i = 0; i < offset; i++) { - //printf(" "); + printf(" "); } printf("%s", tree->v); if (tree->left) { @@ -96,17 +94,17 @@ void knowledge_system(struct tree* node) { return; } - printf("%s", node->v); if (node->left == NULL && node->right == NULL) { + printf("%s", node->v); printf("Koniec\n"); return; } + printf("%s", node->v); printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n"); char response; do { - printf("%s", node->v); scanf(" %c", &response); if (response != 'a' && response != 'n') { printf("Nespravny vstup\n"); @@ -123,7 +121,7 @@ void knowledge_system(struct tree* node) { int main() { printf("Expert z bufetu to vie.\n"); - + int counter = 0; struct tree* root = read_tree(&counter);