123
This commit is contained in:
parent
14a335d999
commit
2424a630a8
@ -126,22 +126,25 @@ int main(void) {
|
||||
}
|
||||
printf("%s\n", cur->text);
|
||||
if (!fgets(buf, sizeof(buf), stdin)) {
|
||||
printf("Nerozumiem\n");
|
||||
return 0;
|
||||
printf("Koniec vstupu\n");
|
||||
break;
|
||||
}
|
||||
char *p = buf;
|
||||
while (*p && isspace((unsigned char)*p)) p++;
|
||||
char c = *p;
|
||||
if (c == '\0' || c == '\n') {
|
||||
printf("Koniec vstupu\n");
|
||||
break;
|
||||
}
|
||||
if (c == 'a' || c == 'A') {
|
||||
cur = cur->yes;
|
||||
} else if (c == 'n' || c == 'N') {
|
||||
cur = cur->no;
|
||||
} else {
|
||||
printf("Nerozumiem\n");
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("Koniec\n");
|
||||
|
||||
free_tree(root);
|
||||
for (int i = 0; i < lines_count; ++i) free(lines[i]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user