Compare commits

..

No commits in common. "4099b4e7cefaee25ac19a5370ecd3d3e07b374ad" and "f5ffb2ffdeec41544b639f0438af1d9058cae19a" have entirely different histories.

View File

@ -79,13 +79,13 @@ void run_system(Tree *node) {
// list -> koniec
if (!node->left && !node->right) {
printf("Koniec\n");
return;
}
int c = getchar();
if (c == EOF) {
printf("Koniec vstupu\n");
char c;
if (scanf(" %c", &c) != 1) {
printf("Nerozumiem\n");
return;
}
@ -94,7 +94,7 @@ void run_system(Tree *node) {
} else if (c == 'n') {
run_system(node->right);
} else {
printf("Koniec vstupu\n");
printf("Nerozumiem\n");
}
}
@ -103,14 +103,14 @@ int main() {
// nepodarilo sa nacitat koren -> chyba
if (!root) {
printf("Koniec vstupu\n");
printf("Chyba\n");
return 0;
}
// skontrolovat prazdny riadok
char buffer[SIZE];
if (!fgets(buffer, SIZE, stdin) || strcmp(buffer, "\n") != 0) {
printf("Koniec vstupu\n");
printf("Chyba\n");
destroy_tree(root);
return 0;
}