du6 - 4
This commit is contained in:
parent
f5ffb2ffde
commit
c979111484
@ -79,13 +79,13 @@ void run_system(Tree *node) {
|
||||
|
||||
// list -> koniec
|
||||
if (!node->left && !node->right) {
|
||||
printf("Koniec\n");
|
||||
return;
|
||||
}
|
||||
|
||||
char c;
|
||||
if (scanf(" %c", &c) != 1) {
|
||||
printf("Nerozumiem\n");
|
||||
int c = getchar();
|
||||
|
||||
if (c == EOF) {
|
||||
printf("Koniec vstupu\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -103,14 +103,14 @@ int main() {
|
||||
|
||||
// nepodarilo sa nacitat koren -> chyba
|
||||
if (!root) {
|
||||
printf("Chyba\n");
|
||||
printf("Koniec vstupu\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// skontrolovat prazdny riadok
|
||||
char buffer[SIZE];
|
||||
if (!fgets(buffer, SIZE, stdin) || strcmp(buffer, "\n") != 0) {
|
||||
printf("Chyba\n");
|
||||
printf("Koniec vstupu\n");
|
||||
destroy_tree(root);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user