Aktualizovat du5/program.c
This commit is contained in:
parent
ca7a7f6911
commit
057ae34354
@ -39,7 +39,8 @@ int buildATree()
|
||||
int current = nodeCount;
|
||||
nodeCount += 1;
|
||||
|
||||
if (line[0] == '*') {
|
||||
if (line[0] == '*')
|
||||
{
|
||||
tree[current].isAnswer = true;
|
||||
strcpy(tree[current].text, line + 1);
|
||||
tree[current].yes = invalidIndex;
|
||||
@ -77,7 +78,11 @@ void goThroughTheTree(int rootIndex)
|
||||
printf("%s\n", tree[current].text);
|
||||
|
||||
//nacitanie odpovedi (jeden char)
|
||||
scanf(" %c", &input);
|
||||
if (scanf(" %c", &input) != 1)
|
||||
{
|
||||
printf("Koniec vstupu\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (input == 'a')
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user