Update cv7/program.c
This commit is contained in:
		
							parent
							
								
									d2e45e94aa
								
							
						
					
					
						commit
						85ccde403a
					
				@ -99,22 +99,23 @@ struct tree* read_tree(int *counter) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int main() {
 | 
			
		||||
    int counter = 0;  // Лічильник для присвоєння ідентифікаторів вузлам
 | 
			
		||||
    struct tree *root = read_tree(&counter);  // Читаємо дерево з вводу
 | 
			
		||||
    int counter = 0;
 | 
			
		||||
    struct tree *root = read_tree(&counter);  // Try reading the tree
 | 
			
		||||
 | 
			
		||||
    printf("Expert z bufetu to vie.\n");
 | 
			
		||||
 | 
			
		||||
    // Check if the tree was read successfully
 | 
			
		||||
    if (root == NULL) {
 | 
			
		||||
        printf("Chybna databaza\n");
 | 
			
		||||
        return 0;  // Якщо дерево порожнє, завершуємо виконання
 | 
			
		||||
        return 0;  // Exit if the tree couldn't be read
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Підрахуємо кількість всіх елементів (питань або відповідей) у дереві
 | 
			
		||||
    // If the tree was successfully read, count the number of items
 | 
			
		||||
    int items_count = count_items(root);
 | 
			
		||||
    printf("Pozna %d druhov ovocia a zeleniny.\n", items_count);  // Виводимо кількість елементів
 | 
			
		||||
    printf("Pozna %d druhov ovocia a zeleniny.\n", items_count);
 | 
			
		||||
 | 
			
		||||
    run_system(root);  // Запускаємо систему рішень
 | 
			
		||||
    destroy_tree(root);  // Знищуємо дерево після завершення роботи
 | 
			
		||||
    run_system(root);  // Run the decision-making system
 | 
			
		||||
    destroy_tree(root);  // Free the allocated memory for the tree
 | 
			
		||||
 | 
			
		||||
    return 0;
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user