From 292d614a73d86f4cf4eed64333226dbe7a30660a Mon Sep 17 00:00:00 2001 From: ov075wu Date: Thu, 20 Nov 2025 17:04:12 +0100 Subject: [PATCH] refresh --- du6/program.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/du6/program.c b/du6/program.c index 4416a94..a91f2de 100644 --- a/du6/program.c +++ b/du6/program.c @@ -17,9 +17,8 @@ static TreeNode* read_tree_node() { return NULL; } - if (buffer[0] == '\n' || buffer[0] == '\r') { + if (buffer[0] == '\n' || buffer[0] == '\r') return NULL; - } TreeNode *node = calloc(1, sizeof(TreeNode)); if (!node) @@ -47,10 +46,8 @@ static void free_tree(TreeNode *root) { static int count_leafs(TreeNode *root) { if (!root) return 0; - if (!root->yes_branch && !root->no_branch) return 1; - return count_leafs(root->yes_branch) + count_leafs(root->no_branch); } @@ -83,7 +80,7 @@ static void run_dialog(TreeNode *root) { char c; if (scanf(" %c", &c) != 1) { - printf("Koniec\n"); + printf("Koniec vstupu\n"); return; } @@ -97,8 +94,7 @@ static void run_dialog(TreeNode *root) { } int main() { - - TreeNode *root = read_tree_node(); + TreeNode *root = read_tree_node(); printf("Expert z bufetu to vie.\n");