Initializacia
This commit is contained in:
parent
302f4d4987
commit
b7e46be38d
@ -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') {
|
||||
|
Loading…
Reference in New Issue
Block a user