Initializacia

This commit is contained in:
Kozar 2024-11-12 18:05:10 +00:00
parent 302f4d4987
commit b7e46be38d

View File

@ -51,12 +51,14 @@ void run_tree(struct tree* tree) {
printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n");
char response;
if (scanf(" %c", &response) != 1) {
printf("Koniec vstupu\n");
return;
} else if (response != 'a' && response != 'n') {
while (1) {
// Wait for user input
if (scanf(" %c", &response) != 1 || (response != 'a' && response != 'n')) {
printf("Nerozumiem\n");
return;
// Re-prompt for input
continue;
}
break; // Valid input received
}
if (response == 'a') {