Aktualizovat du5/program.c

This commit is contained in:
Tomáš Vlček 2026-04-15 10:13:09 +00:00
parent ca7a7f6911
commit 057ae34354

View File

@ -39,7 +39,8 @@ int buildATree()
int current = nodeCount; int current = nodeCount;
nodeCount += 1; nodeCount += 1;
if (line[0] == '*') { if (line[0] == '*')
{
tree[current].isAnswer = true; tree[current].isAnswer = true;
strcpy(tree[current].text, line + 1); strcpy(tree[current].text, line + 1);
tree[current].yes = invalidIndex; tree[current].yes = invalidIndex;
@ -77,7 +78,11 @@ void goThroughTheTree(int rootIndex)
printf("%s\n", tree[current].text); printf("%s\n", tree[current].text);
//nacitanie odpovedi (jeden char) //nacitanie odpovedi (jeden char)
scanf(" %c", &input); if (scanf(" %c", &input) != 1)
{
printf("Koniec vstupu\n");
return;
}
if (input == 'a') if (input == 'a')
{ {