31
This commit is contained in:
		
							parent
							
								
									1aadb65c26
								
							
						
					
					
						commit
						643d6d4670
					
				| @ -52,26 +52,26 @@ void run_expert_system(Node *node) { | ||||
|         printf("Odpovedajte 'a' pre prvu moznost alebo 'n' pre druhu moznost.\n"); | ||||
|         printf("%s\n", node->text); | ||||
| 
 | ||||
|         // Проверка, если это листовой узел
 | ||||
|         // Check if this is a leaf node
 | ||||
|         if (!node->yes && !node->no) { | ||||
|             printf("*%s\n", node->text); // Выводим ответ с звездочкой
 | ||||
|             printf("*%s\n", node->text); // Print the answer with an asterisk
 | ||||
|             printf("Koniec\n"); | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         char answer; | ||||
|         if (scanf(" %c", &answer) != 1) { | ||||
|             printf("Koniec\n"); // Некорректный ввод
 | ||||
|             printf("Koniec\n"); // Incorrect input
 | ||||
|             return; | ||||
|         } | ||||
| 
 | ||||
|         // Переход к следующему узлу
 | ||||
|         // Move to the next node
 | ||||
|         if (answer == 'a') { | ||||
|             node = node->yes; | ||||
|         } else if (answer == 'n') { | ||||
|             node = node->no; | ||||
|         } else { | ||||
|             printf("Koniec\n"); // Некорректный ввод
 | ||||
|             printf("Koniec\n"); // Incorrect input
 | ||||
|             return; | ||||
|         } | ||||
|     } | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user