diff --git a/du5/program.c b/du5/program.c index e6c5e70..751fced 100644 --- a/du5/program.c +++ b/du5/program.c @@ -43,14 +43,7 @@ int buildATree() strcpy(tree[current].text, line + 1); tree[current].yes = invalidIndex; tree[current].no = invalidIndex; - answerCount += 1; - return current; - } - - tree[current].isAnswer = false; - strcpy(tree[current].text, line); - - //rekurzivne vytvorii dalsie 'nodes' (uzly po slovensky) na na zaklade vycitanych odpovedi z standard inputu + //rekurzivne vytvorii dalsie 'nodes' (uzly po slovensky) na na zaklade vycitanych odpovedi z standard inputu tree[current].yes = buildATree(); // 'a' tree[current].no = buildATree(); // 'n' @@ -130,4 +123,11 @@ int main() goThroughTheTree(root); return 0; -} \ No newline at end of file +} answerCount += 1; + return current; + } + + tree[current].isAnswer = false; + strcpy(tree[current].text, line); + + \ No newline at end of file