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