cv7
This commit is contained in:
parent
962c2ab6a1
commit
a3c65d5786
@ -88,20 +88,28 @@ void interact(struct tree *node)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char answer;
|
//while (scanf(" %c", &answer) == 1)
|
||||||
while (scanf(" %c", &answer) == 1)
|
char answer[SIZE];
|
||||||
|
while (fgets(answer, SIZE, stdin))
|
||||||
{
|
{
|
||||||
if (answer == 'a')
|
answer[strcspn(answer, "\n")] = 0;
|
||||||
|
|
||||||
|
|
||||||
|
if (answer[0] == '\0')
|
||||||
|
{
|
||||||
|
printf("Koniec vstupu\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(answer, "a") == 0)
|
||||||
{
|
{
|
||||||
interact(node->left);
|
interact(node->left);
|
||||||
return;
|
return;
|
||||||
}
|
} else if (strcmp(answer, "n") == 0)
|
||||||
else if (answer == 'n')
|
|
||||||
{
|
{
|
||||||
interact(node->right);
|
interact(node->right);
|
||||||
return;
|
return;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
{
|
{
|
||||||
printf("Nerozumiem\n");
|
printf("Nerozumiem\n");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user