du5
This commit is contained in:
parent
3510447854
commit
dd8557e042
@ -23,14 +23,12 @@ Tree* readTree() {
|
||||
|
||||
if (line[0] == '*') {
|
||||
node->isAnswer = 1;
|
||||
|
||||
int i = 1;
|
||||
while (line[i] == ' ') i++;
|
||||
strcpy(node->text, line + i);
|
||||
} else {
|
||||
node->isAnswer = 0;
|
||||
strcpy(node->text, line);
|
||||
|
||||
node->yes = readTree();
|
||||
node->no = readTree();
|
||||
}
|
||||
@ -64,10 +62,8 @@ void start(Tree *n) {
|
||||
|
||||
if (in[i] == 'a')
|
||||
n = n->yes;
|
||||
else if (in[i] == 'n')
|
||||
n = n->no;
|
||||
else
|
||||
return;
|
||||
n = n->no;
|
||||
}
|
||||
|
||||
if (n) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user